How to Install Latest Firefox as classic Deb in Ubuntu 22.04

Ubuntu 22.04 finally removed the .deb package for Firefox web browser from it’s repository! Here’s how to install it back.

As you may know, Firefox in Ubuntu 22.04 is a Snap package that runs in sandbox. It’s easy to remove it. But when you try installing the deb package via apt, it just install the Snap version back!!

Like Chromium, the Firefox deb in Ubuntu 22.04 is an empty package that links to the Mozilla’s official Snap.

Ways to get Firefox in Ubuntu as deb:

Snap is OK. But when you trying to install Gnome Extensions, the browser doesn’t work at the moment! So, you need workarounds:

  • Firefox Linux tarball from Mozilla website
  • Firefox ESR PPA.
  • Firefox PPA.
  • Ubuntuzilla repository

The Linux tarball is a good choice, but it lacks desktop shortcut integration. And you have to manually download the latest package every time a new release is out!

Ubuntuzilla apt repository is another choice. Ubuntu refers to this repository many years ago when it was not updating Firefox package itself.

I prefer Ubuntu PPA via a bit more, and the “Mozilla Team” team PPA is what I’m going to introduce in this tuturial.

Install Firefox via “Mozilla Team” team PPA

The team described that it has assumed responsibility for Ubuntu’s official Firefox and Thunderbird packages.

And, the Firefox and Firefox ESR package maintainer for “Mozilla Team” team PPA, Rico Tzschichholz, is a well-known Ubuntu user who also maintains the official pakages for LibreOffice, Plank dock, and unbound DNS server.

1. Remove Firefox Snap

It’s OK to keep the default Snap package. But it will cause duplicated icons in search results.

NOTE: Export bookmarks and backup other important data before removing it!

To remove it, press Ctrl+Alt+T on keyboard to open terminal. Then, run the command:

sudo snap remove firefox

2. Add Mozilla Team PPA

In terminal, run the command below to add the PPA. Type user password (no asterisk feedback) when it asks and hit Enter to continue.

sudo add-apt-repository ppa:mozillateam/ppa

As the PPA description indicates, the PPA was previously created for Firefox ESR and Thunderbird. It now contains the latest Firefox too.

3. Install Firefox via apt

Tip: the commands in this step also installs Firefox for the old Ubuntu 16.04. Though sudo apt update need to be run first.

Finally, run the command below to install the latest Firefox package as deb:

sudo apt install -t 'o=LP-PPA-mozillateam' firefox

Here -t 'o=LP-PPA-mozillateam' specifies to install Firefox from that PPA. It’s required until you set higher PPA package priority (see next step).

For choice, you may install Firefox ESR instead. It’s another official Firefox package that moves slowly and targets for school or enterprise use.

sudo apt install firefox-esr

4. Set PPA priority:

The empty Firefox deb in Ubuntu’s official repository has version number 1:1snap1-0ubuntu2. It’s always higher than the PPA package version. Running package updates either via sudo apt upgrade or ‘Software Updater’ will automatically install the official one which redirects to Snap.

To workaround the issue, you have to set a higher PPA priority. To do so, run the command below in terminal (Ctrl+Alt+T):

sudo gedit /etc/apt/preferences.d/mozillateamppa

The command creates and opens empty config file in Gedit text editor. When it opens, add the lines below and save it:

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

After saving the file, run sudo apt update command in terminal to apply changes.

sudo apt update

How to Restore Firefox Snap:

Just remove the Mozilla Team PPA using ‘Software & Updates‘ utility under Other Software tab.

After that, either launch Software Updater to upgrade Firefox or use apt command below. Both of which will automatically install back the pre-installed Snap package.

sudo apt update && sudo apt install firefox

That’s all. Enjoy!

Original Article