2

I upgraded my 20.04 Ubuntu 22.04 recently. I opted out of the default "Snap" Firefox, and followed these instructions to replace it with the Firefox maintained in the Mozilla Team PPA repository.

However, I've just done an update & upgrade on my system (I use apt for this instead of the Software Updater), and Firefox looks like it may have reverted to the default "Snap" version. From the Help, About Firefox window I see the statement "Mozilla Firefox for Ubuntu canonical - 1.0" as shown in the screenshot:

Question: How can I tell if I've got the Snap version, or the PPA version?

Please note that I'm not asking how to install it as there are plenty of tutorials, and a Q&A here in SE addressing that. I simply want to know how to verify that I've got the PPA version (or the SNAP version).

enter image description here

Seamus
  • 698

2 Answers2

6

One option is to find Firefox process in System Monitor and open its properties. Snap version runs from /snap location with Security Context set. firefox process properties

R A
  • 927
3

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.

System Monitor output showing both snap and apt versions running

CG3
  • 316
  • 1
  • 7