Installing Apache Spark (snap)

Hello, I am using Manjaro Linux 5.9.1-1-MANJARO #1 SMP PREEMPT x86_64 GNU/Linux and tried installing Apache spark by following the sequence of commands:

1.) “snapd” can be installed from the command line:
$ sudo pacman -S snapd

2.) Once installed, the “systemd” unit that manages the main snap communication socket needs to be enabled:
$ sudo systemctl enable --now snapd.socket

3.) To enable “classic” snap support, enter the following to create a symbolic link between /var/lib/snapd/snap and /snap:
$ sudo ln -s /var/lib/snapd/snap /snap

Either log out and back in again, or restart your system, to ensure snap’s paths are updated correctly.

4.) To install spark, simply use the following command:
$ sudo snap install spark --edge

However, after the command: “sudo snap install spark --edge”, it shows that “spark” is installed. However, when I try to access spark through terminal using “spark-shell”, it gives the output:
bash: apache-spark: command not found

When I retry installing using the command:
$ sudo snap install spark --edge
snap “spark” is already installed, see ‘snap help refresh’

What should I do?

Thanks!

Don’t install Apache and spark using snap but by using the full packages…

Why oh why?

Snaps are a wonderful thing if you want to containerize your applications and not having them talk to other applications. They’re total and utter :poop: if you want the applications to interact with your desktop, with other applications, … which seems to be the case you want but are not getting: Apache and spark don’t see one another…

:man_shrugging:

1 Like

run echo $PATH in terminal to check if /snap/bin is included. If not, add the following line to .bashrc or .zshrc (works for terminals only)

export PATH=/snap/bin:$PATH

PS: Quite often, the snaps rename their executable for reasons unbeknownst to me. Maybe spark is called fancy-word.spark.more-fancy-words, check /snap/bin contents for exact name. If the script (i presume) apache-spark is hardcoded to call spark, you need to create a symbolic link with the name spark in /snap/bin.

1 Like