On Ubuntu 22.04+, Firefox started shipping as a Snap package, and it's even worse if you try to remove and reinstall it using the APT package manager; it will reinstall as a Snap package.

Now, there is an advantage to Snap, such as improved security, restricted permissions, easy access to release channels, automatic background updates, and easy undoing of updates.

However, most of the time, users do not prefer using Firefox as a Snap package for many reasons, such as avoiding sandbox technology, certain feature issues in the sandbox, system integration issues, startup time issues, and a lack of control over the auto-update.

So, in this situation, you can either apply the available fixes for your particular problem or simply follow this article to easily install Firefox as a DEB package via APT.

How to Install Firefox as a DEB Package via APT

In the January 2024 release of Firefox 122, Mozilla announced an official custom APT repository for Debian and Ubuntu-based distributions, allowing the installation of the latest stable Firefox release as a DEB package.

Now, before adding the APT repo to your system via command-line, ensure two things: that you haven't already added the APT repo and that you have backups of your bookmarks, browser settings, extensions, etc., for safety.

Once you're ready, open your terminal and follow the below-mentioned steps one by one to install Firefox as a DEB package via APT on your Debian and Ubuntu-based distributions.

1. Remove the Firefox Snap:

  • sudo snap remove firefox

2. Create an APT keyring (if one does not already exist):

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

3. Import the Mozilla APT repo signing key:

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

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

5. Make the Firefox DEB package the top priority during Firefox installation via APT. Skipping this step will result in the reinstallation of the Firefox Snap package.

echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000
' | sudo tee /etc/apt/preferences.d/mozilla

6. Finally, install Firefox as a DEB package via APT:

  • sudo apt update && sudo apt install firefox

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

For example, the following command will install the Spanish language package for Firefox.

  • sudo apt install firefox-l10n-es-es

Tada!! You have successfully installed the DEB version of Firefox.

Data Migration to Installed Firefox as a DEB Package

If you have previously been using the Snap or Flatpak variants of Firefox, there are two different ways to migrate your data to a Firefox DEB installation.

1. Signing into your Firefox account syncs your items, such as bookmarks, add-ons, open tabs, settings, etc. Log in with the same Firefox account on your Firefox DEB installation for syncing.

2. Close all opened Firefox instances on your computer and copy the existing Snap or Flatpak files to the Firefox DEB installation location.

  • For Snap
  • mkdir -p ~/.mozilla/firefox/ && cp -a ~/snap/firefox/common/.mozilla/firefox/* ~/.mozilla/firefox/
  • For Flatpak
  • mkdir -p ~/.mozilla/firefox/ && cp -a ~/.var/app/org.mozilla.firefox/.mozilla/firefox/* ~/.mozilla/firefox/

Once the file is copied, open Firefox from your terminal using the firefox -p command and select your desired profile.

That's all it takes to install the Firefox DEB package on Debian, Ubuntu, Linux Mint, etc.