Do you want to install Mozilla Firefox as a DEB package on Ubuntu 22.04 LTS and above, not as a snap app?

In this guide I show you how to do that using the official Mozilla APT repo.

Firefox has been Ubuntu’s default browser since 2004, and for most of that time was provided as a DEB package. In 2021 Ubuntu switched a Firefox snap for all users, with Canonical (who make Ubuntu) saying Mozilla requested the change so they could get updates out faster.

You cannot uninstall the Firefox snap and run apt install firefox to install a DEB version in Ubuntu. This is because the Firefox DEB in the Ubuntu repos is a ‘transition package’ – a dummy one that reinstalls the Firefox snap.

The Firefox DEB package in the Ubuntu repos will reinstall the Snap package

Snap apps have plenty of benefits, like improved security, faster access to updates, options to “undo” updates and revert back to an older build, no dependency issues, and more.

But their integration isn’t flawless.

Depending on the kind of app some features may not work in a sandbox; system integration may be affected; startup times may be slower; and automatic background updates can result in issues.

Workarounds, fixes, and ways to mitigate issues with snaps exist. For example, Canonical added new terminal commands to let users pause automatic updates for a set duration. But the fact people need research to learn how to do those things isn’t ideal.

In this guide I show you how to replace the Firefox snap with a Firefox DEB.

Installing Firefox via Apt (Not Snap)

image showing a DEB package icon with a tick, the Firefox browser logo, and a Snap package icon with a cross
Snap isn’t the only way to get Firefox in Ubuntu

Mozilla has a dedicated APT repo for Debian-based distros (like Ubuntu). This packages the latest stable release of Firefox as a DEB package. The repo is fairly new, going live with the release of Firefox 122 in January 2024 – but is already very popular.

You can add the Mozilla APT repo to Ubuntu using the command line (this is the way Mozilla recommends).

You can add it using a GUI (i.e., no commands) but it is a lengthy process, easier to ‘mess up’, and something I won’t be covering in this post.

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.

Plus, adding APT repo is only half of the process. You will need to ‘pin’ the Firefox DEB package to prevent Ubuntu from reinstalling its transition package (which reinstalls the Firefox snap).

Before continuing be sure to make a backup or export of important browser settings, bookmarks, data, etc., from your existing Firefox installation.

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 is always preferred. If you don’t do this the Ubuntu transition package will be reinstalled, and you’ll have the Firefox snap:

echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000

Package: firefox*
Pin: release o=Ubuntu
Pin-Priority: -1' | sudo tee /etc/apt/preferences.d/mozilla

Step 6: Finally, use APT to remove Ubuntu’s pretend Firefox DEB (if still present) and installed the real-deal from Mozilla’s repository:

sudo apt update && sudo apt remove firefox
sudo apt install firefox

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

sudo apt install firefox-l10n-fr

A list of all available language packs (listing the package name you need to install) can be seen by running the apt-cache search firefox-l10n command.

Once the repo has been set up and you’ve installed Firefox from it you can go ahead and open it. Open the app picker/menu on your Ubuntu (or flavour), click the Mozilla Firefox icon, and the non-Snap Firefox build, and you can continue on

Be sure to pin the icon to the Ubuntu Dock (or equivalent if you’re using an Ubuntu flavour) for easier access.

Sidenotes…

Do not remove the Firefox snap if you don’t need to. If you’re not experiencing issues with it, don’t have a specific reason/need for a non-Snap build, just keep using it.

And even if you do have issue the snap is being improved all the time. System integration issues with the Firefox snap package (like the one affecting 3rd-party password managers) are being worked on by Ubuntu developers. Hang tight for a solution.

Otherwise, if you’re certain you want the DEB version, now you know how to get it.