February 2, 2024

How to Install Firefox as DEB on Ubuntu (Not Snap)

So you want to install Mozilla Firefox as a Deb package on Ubuntu 22.04 LTS (or above), not as a snap app. 

No problem; in this guide I show you how using the official Mozilla APT repo.

Firefox is the default web browser in Ubuntu but as of 2022 it’s packaged as a snap app, with a traditional DEB version only available for users of Ubuntu 18.04 LTS and earlier.

Worse, if you uninstall the Firefox snap and run apt install firefox assuming you will get a DEB version, you won’t: that install a transition package that reinstalls the Firefox snap.

The Firefox Deb in the Ubuntu repos just reinstalls the Firefox Snap package…

Now, snap packages have plenty of pluses, including improved security, easy access to release channels, options to “undo” updates, less chance of package conflicts or missing dependencies, and more.

But there are also drawbacks to using snaps.

Depending on the software, features may not work in a sandbox; system integration may be lacking; startup times can seem slow; and you won’t be able choose whether to install an update or not, as updates happen automatically, silently in the background.

Although workarounds and fixes many of the issues above do exist (for example, Canonical has added new terminal commands to pause automatic updates for a set duration) the fact you need to scour the web for a solution is not ideal.

So to install a Firefox Deb in Ubuntu 22.04 LTS and above, here’s what you need to do.

Installing Firefox via Apt (Not Snap)

With the release of Firefox 122 in January 2024 Mozilla announced its own dedicated APT repo for Debian-based distros (including Ubuntu). This contains new, stable releases of Firefox as a DEB package.

To add the Mozilla APT repo you should use command line as it’s the most efficient way (and the way Mozilla themselves recommend). You can add the repo using a GUI but it’s a lengthy process and easier to ‘mess up’.

You will also need to ‘pin’ the Firefox Deb package after installation. This will prevent Ubuntu’s transition package from overwriting it to reinstall the Firefox snap.

Note: if you previously added the Mozilla Team PPA to install a Firefox Deb package you should disable or remove the PPA to avoid package conflicts.

Before you go ahead I suggest making a backup/export of important browser settings, bookmarks, and other data from Firefox incase something goes wrong.

When you’re done:

Step 1: Uninstall the Firefox Snap:

sudo snap remove firefox

Step 2: Create an APT keyring (if one doesn’t already exist):

sudo install -d -m 0755 /etc/apt/keyrings

Step 3: Import the Mozilla APT repo signing key (if wget is missing install it first):

wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null

Step 4: Add the Mozilla signing key to your sources.list:

echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null

Step 5: Set the Firefox package priority to ensure Mozilla’s Deb version is always preferred. If you don’t do this the Ubuntu transition package could replace it, reinstalling the Firefox Snap:

echo '

Package: *

Pin: origin packages.mozilla.org

Pin-Priority: 1000

' | sudo tee /etc/apt/preferences.d/mozilla

Step 6: Finally, install the Firefox DEB in Ubuntu:

sudo apt update && sudo apt install firefox

Step 7 (Optional): To use a localised version of Firefox (i.e. the UI in a language other than American English) you need to install the corresponding language package, e.g., for French:

sudo apt install firefox-l10n-fr

You can see a list of all available language packs by running apt-cache search firefox-l10n.

Once you’ve installed everything open the app launcher, click the Mozilla Firefox icon to open your new non-Snap Firefox build, and away you go. Pin the icon to the Ubuntu Dock if you need to.

Sidenotes…

Keep in mind that any bugs, missing features, and missing system integrations with the Firefox snap package (like the ones affecting 3rd-party password managers) are being addressed by Ubuntu developers, so consider hanging tight for a solution.

Otherwise, roll with the Deb as detailed above.

Some of you have asked me how to replace the Firefox Snap with a Deb version (you can also download, move, and link to the Firefox binary as an alternative) but this method feels like the best solution.

Source: https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04