Raven - Blog
April 22, 2022

Ubuntu 22.04 - Alternative to the Firefox snap

Posted on April 22, 2022  •  4 minutes  • 815 words  • Other languages:  Français
UPDATE ON 2022/11/11: The integration of Native Message arrived today in the snap! It is now (finally) possible to use extensions like KeepassXC or the one for Gnome plugins. Thanks Mozilla.
UPDATE ON 2022/10/26: The launch time and stability issues of the Firefox snap have all been fixed (for me). Native Message integration to manage communication with external applications is available in the Firefox beta and will soon be in the stable version of the snap.

On 2022/04/21 was released the long awaited Ubuntu 22.04 aka “Jammy Jellyfish” which is a major new version of Canonical’s OS and what’s more, the new Long Term S Support for the next two years with 5 years support.

This 22.04 release is really excellent, modern, more powerful and full of little new features .

Only, there is a bad point, it is the passing of Firefox on the Snap version of the package. I won’t dwell on the controversy around Snap, the “containerized” applications of which there are mainly 3 competing technologies (Snap, Flatpak, Appimage) have many advantages in terms of security, dependency management, etc. Canonical is responsible for this choice, but the decision to switch Firefox to Snap at the expense of .deb would be Mozilla's initiative too .

Anyway, our good Mozilla Firefox is installed on Snap and this poses two major problems for me:

  1. The launch time of Firefox in Snap is 10 to 15 seconds. That’s huge, really, and again I’m lucky to have a very recent machine with an 11th generation core i7, 16GB of RAM and 1TB of NVMe SSD.
  2. The incompatibility of some extensions like KeePassXC which can't communicate with the open base or the one managing Gnome extensions.

Therefore, until Canonical fixes these two issues, it is for me, as for many others, impossible to use Firefox as a Snap. If you are in the same situation as me, I’ll show you how:

1 - Locate and save your Firefox Snap profile

To locate your Firefox profile, open a browser window and type in the URL bar: about:support

Locate the line “Profile Directory “ in the table and save your profile directory.

2 - Uninstall the Firefox Snap

You can use the Ubuntu software utility or enter the command :

snap remove firefox

3 - Installing Firefox via Mozilla PPAs

A - Adding PPA repositories

The PPA we are interested in is the one maintained by Mozilla here .

To add it to your repositories, open a terminal and type the following command:

sudo add-apt-repository ppa:mozillateam/ppa

Once the repository is added, we can see that the Snap package remains a priority and “candidate” over the PPA:

Snap priority

B - Changing the priority of the PPA repository

Let’s change the priority of the PPA repository and set the snap priority to -1 by creating the file /etc/apt/preferences.d/mozillateamppa with the content :

Package: firefox*
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 501

Package: firefox*
Pin: release o=Ubuntu*
Pin-Priority: -1

After verification, the package resulting from the PPAs is now a priority and you will be safe during the next updates: the Snap package will not come back !

PPA priority

C - Integrating the PPA into the UnattendedUpgrades process

Finally, to integrate the PPA repository in the “UnattendedUpgrades” process which is the package that allows to install the latest security updates automatically, you have to create the file /etc/apt/apt.conf.d/51unattended-upgrades-firefox with the content :

Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";

D - Installation of firefox

It only remains to launch the installation of firefox with :

sudo apt-get install firefox firefox-locale-fr

UPDATE of 02022/04/24 : Some people need to do an additional apt purge firefox when coming from the previous LTS, namely Ubuntu 20.04. Thanks to @didiermisson for his remark on Twitter 👍

4 - Restore your Firefox profile

If you come from a non-Snap version of Firefox (version prior to Ubuntu 21.10) you will not have to do anything because your old profile is not deleted during the automatic installation of the Snap when upgrading from Ubuntu. Firefox will start and get your profile available in your personal folder in the folder .mozilla/firefox/XXXXXXX.default . It’s over for you!

For those who come from a “from scratch” installation, you can reimport your old profile by following this short documentation on the mozilla website: Restore a Firefox profile backup


Conclusion

Today, Canonical’s promise made last October to have a Snap package of Firefox that is fast to launch and free of bugs or lack of some major features is not kept. This is really regrettable and damaging. I hope they will quickly make Firefox as a Snap usable or backtrack with Mozilla teams to bring back the “.deb”. To be continued in the next months!

NB: In this tutorial, I focused on the installation via the PPA repository method. There are other installation methods (flatpack, tarball…).

Follow me

Subscribe to my RSS feed !