Install Firefox – How to Install Firefox as a Traditional Deb Package in Ubuntu 22.04 or Later

22.04firefoxppasnapsoftware installation

As far as I see in the ongoing development for 22.04 Jammy, Firefox is a Snap package.
The related Deb package in apt is just a shortcut/link to the that snap version.

I prefer my installation not to be from snap packages, since I find them too much 'Ubuntu-specific'.

Are there alternative ways to install Firefox on Jammy?
My favourite option would be an Apt repository or PPA. I will test the Flatpak version with my test virtual machine in the meantime.

Best Answer

If you switch to the APT version, you will lose the bookmarks in the snap version unless you sync them with your Firefox account, or export them manually.


The other answer by Organic Marble is for Firefox-ESR, and the answer by eddygeek is for the beta version.

This answer is for the latest stable version of Firefox. You can use the Firefox PPA maintained by Mozilla team.

sudo add-apt-repository ppa:mozillateam/ppa

Then, copy and paste the following code in a terminal in one go (don't copy-paste line by line) to prioritize the apt version of firefox over the snap version.

echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001

Package: firefox
Pin: version 1:1snap1-0ubuntu2
Pin-Priority: -1
' | sudo tee /etc/apt/preferences.d/mozilla-firefox

Next, remove the snap version of firefox

sudo snap remove firefox

If you see the following error,

error: cannot perform the following tasks:
- Remove data for snap "firefox" (1943) (unlinkat /var/snap/firefox/common/host-hunspell/en_ZA.dic: read-only file system)

Then run the following commands (source) to disable the hunspell service, and try removing Firefox snap once again.

sudo systemctl stop var-snap-firefox-common-host\\x2dhunspell.mount
sudo systemctl disable var-snap-firefox-common-host\\x2dhunspell.mount
sudo snap remove firefox

Install Firefox with apt.

sudo apt install firefox

To ensure that unattended upgrades do not reinstall the snap version of Firefox, enter the following command. Alternatively, you can turn off unattended upgrades.

echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox

To undo these changes

  1. Remove the firefox PPA.
sudo add-apt-repository -r ppa:mozillateam/ppa
  1. Remove the apt pin.
sudo rm -rf /etc/apt/preferences.d/mozilla-firefox
  1. Remove the apt version and reinstall snap.
sudo apt remove firefox && sudo snap install firefox

Source: OMG Ubuntu