Actually, symbolic links are located in /snap/bin
the executable snaps are in /snap
under a folder of it's name. The output of ls -l $(which firefox)
will show you the file path that is launched for what is found first based on the definition of your $PATH
environment variable:
This one is the apt
version that can also be seen with apt list firefox --installed
(if it is installed it will say [installed]
):
$ apt list firefox --installed
Listing... Done
firefox/focal-updates,focal-security,now 104.0+build3-0ubuntu0.20.04.1 amd64 [installed]
$
$ ls -l $(which firefox)
lrwxrwxrwx 1 root root 25 Aug 18 22:25 /usr/bin/firefox -> ../lib/firefox/firefox.sh
The shell $PATH
will determine which version is launched first. If you have both installed, it will find the first version based on looking through the file paths defined from left to right, which may vary. The defined $PATH
can be changed (take care here!) to redefine which version is launched. This is not typically the way it is done. It's often easier to define an alias to do this and leave the variable alone:
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
$ PATH=/snap/bin:$PATH
$ echo $PATH
/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
$ ls -l $(which firefox)
lrwxrwxrwx 1 root root 13 Sep 13 14:12 /snap/bin/firefox -> /usr/bin/snap
You could further launch Firefox and see which version is running:
$ firefox &
$ for i in $(pgrep firefox); do cat /proc/$i/cmdline ; echo ; done
/usr/lib/firefox/firefox-new-window
/snap/firefox/1810/usr/lib/firefox/firefox
That first version is the apt
version and the second is the snap
version and yes, both versions can run at the same time.
