Install Firefox as a DEB App on Ubuntu 22.04: The Proper Way

This guide shows you how to install Firefox as a classical DEB application on Ubuntu 22.04 LTS from Mozilla's official repository.

Great news for Ubuntu users! Mozilla has just launched an official repository for you to download and install the Firefox browser as a native application easily. This is a fantastic option, especially if you’re looking for an alternative to the default Snap package version of Firefox that comes by default with Ubuntu.

But before proceeding, let’s clarify why this new option might be better for you.

  • Enhanced Performance: With over 25 years of expertise, Mozilla’s deep knowledge of Firefox enables it to optimize its performance using advanced techniques. Remember, using other DEB packages might mean missing out on these enhancements.
  • Prompt Updates: Stay up-to-date effortlessly with Firefox. Mozilla’s new APT repository links directly to their release cycle, bringing you the latest features and security updates faster.
  • Mozilla’s Own Build: Firefox from Mozilla’s repo is 100% made by Mozilla! This means you get an unmodified directly-from-the-source Firefox.

Now that we’ve cleared things up let’s dive into the main focus of this guide: installing Firefox as a traditional DEB application on Ubuntu 22.04 LTS. The first thing we’ll need to do is remove its Snap version.

Remove Ubuntu Firefox’s Snap Version

You might have checked out some other guides before finding ours. However, some of them sometimes miss a crucial step before installing the DEB version of Firefox on Ubuntu: removing the current Snap one. But hey, if you overlook this step, though, you’ll end up with this:

A duplicated version of Firefox is installed on Ubuntu 22.04.

That’s amazing! Having two identical versions of the same app is like a dream come true, right? Just imagine being able to pick whichever one you feel like using. But no more nonsense – just a little joke there!

We take our guides very seriously and always ensure they’re thoroughly tested and reliably effective. We’re really proud of this! You’re in luck being here with us because we guarantee you’ll find the best solutions and approaches.

So, to start off, let’s uninstall the Snap version of Firefox, which is quite simple. First, open your Terminal application. Once it’s open, you’ll need to run the following command.

sudo snap remove --purge firefox
Remove Ubuntu Firefox's Snap version.

Alright, we’re all done saying farewell to the Firefox Snap version. Next up, let’s switch gears and install Firefox as a native DEB application on our Ubuntu 22.04 system.

Install Firefox as a DEB App on Ubuntu 22.04 LTS

Import Mozilla Repo’s Key

Let’s first add the Mozilla APT repository signing key to get started. This is essential because it confirms that the software we’re installing is genuinely from Mozilla. It’s like getting a seal of approval for its authenticity, reliability, and safety.

So, first, let’s pull it out and put it in its proper place.

wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/nullCode language: JavaScript (javascript)
Import the Mozilla APT repository signing key.

As you can see, the command didn’t produce any output, but no worries, that’s completely normal. Let’s keep going!

Next, let’s do the import itself:

gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); print "\n"$0"\n"}'Code language: JavaScript (javascript)
Import the Mozilla APT repository signing key.

You should get the fingerprint “35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3,” which guarantees you that the key you’ve imported is authentic.

Add the Firefox Repo to your Ubuntu 22.04 System

Let’s go ahead and add Mozilla’s official repository, hosting the DEB packages we need to install Firefox, to our Ubuntu system. The command below (again) won’t produce any visible results.

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/nullCode language: PHP (php)
Add the Firefox repo to your Ubuntu 22.04 system.

Prioritize Mozilla’s Repo

Let’s take a moment to understand why it’s important for us to give priority to the new Mozilla repository we’ve added and what this really involves. We like to do things this way, ensuring everything is clear before proceeding to the next step.

In Ubuntu, the APT command handles packages, including installing, updating, and removing software. But sometimes, multiple repositories are added to your system that provide different versions of the same package, as is the case with Firefox.

In other words, the browser is now available from our newly added Mozilla repository. Plus, it’s also in the Ubuntu one as a Snap package. Here’s a fun fact: if you type “apt install firefox” now, you’ll end up downloading and installing its Snap version. But that’s not what you’re looking for!

To avoid this, we’ll use a mechanism called “pinning” in APT. We must tell APT to prioritize the Mozilla repository as the first option when installing Firefox. Copy the snippet below and execute it in the terminal:

echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000
' | sudo tee /etc/apt/preferences.d/mozillaCode language: PHP (php)
Prioritize Mozilla's repo.

This way, you’re essentially saying, “Hey APT, I trust and prefer this repository more, so please use packages from here whenever possible.”

Install Firefox from Mozilla’s Repo on Ubuntu 22.04 LTS

It’s time to reap the rewards of our hard work. Let’s refresh our list of software, and you’ll be pleased to find that it now includes our newly added Mozilla repository.

sudo apt update
Install Firefox from Mozilla's repo on Ubuntu 22.04 LTS.

Finally, go ahead and install Firefox in the usual way by executing the following command:

sudo apt install firefox
Install Firefox from Mozilla's repo on Ubuntu 22.04 LTS.

Once the installation is finished, go to the GNOME dash and type “firefox” to find it. Then, you’re all set to launch and enjoy it in its most up-to-date version!

Launching Mozilla Firefox on Ubuntu 22.04 LTS.
Mozilla Firefox was installed and run on Ubuntu 22.04 LTS as a native DEB app.

Conclusion

There you have it – a comprehensive step-by-step guide to installing Firefox as a native DEB application on Ubuntu 22.04 LTS directly from Mozilla’s official repository. This method offers various benefits, including enhanced performance, prompt updates, and the authenticity of Mozilla’s own build.

In addition, by following this guide, you’ve learned how to install Firefox in a more traditional and arguably efficient way and gained some insight into the workings of Ubuntu’s package management system.

So, enjoy your newly installed Firefox browser and the improved web experience it brings. Thanks for your time! Your feedback and comments are, as always, most welcome.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%

10 Comments

  1. Many thanks for this guide, I will be using it for every Ubuntu install from now on to have a stable and working Firefox install.

  2. In my Ubuntu 22 LTS setup, I use very little Snap, Flatpak and DEB installs. I prefer Standalone Binaries or Appimages. My Firefox is the Standalone Binary version and it runs silky smooth. It just updated to version 122 a little while ago. It only downloaded the necessary updated files, about 20MB. Just my 2 cents worth.

  3. FWIW: I use the following procedure to make use the mozilla team’s launchpad packages on ubuntu:

    # purge firefox.snap
    sudo apt-get purge firefox
    # may fail – don’t care.
    sudo umount /var/snap/firefox/common/host-hunspell

    # to get rid of snapd junk (optional but recommended ;))
    sudo apt-get purge snapd
    sudo rm -rf /snap /var/snap /etc/systemd/system/snap* \
    /etc/udev/rules.d/70-snap.* /etc/apparmor.d/abstractions/snap_browsers \
    /etc/systemd/system/multi-user.target.wants/snap* \
    /etc/systemd/system/multi-user.target.wants/var-snap* \
    /etc/systemd/system/var-snap* \
    /var/cache/apparmor/*/snap*
    sudo sed -i -e ‘/snap/ d’ /etc/apparmor.d/usr.bin.evince

    # hint apt
    printf ‘deb http://ppa.launchpad.net/mozillateam/ppa/ubuntu jammy main\n’ | \
    sudo tee /etc/apt/sources.list.d/mozilla.list
    printf ‘Package: *\nPin: release o=LP-PPA-mozillateam\nPin-Priority: 999\n’ | \
    sudo tee /etc/apt/preferences.d/mozilla.pref
    gpg –keyserver keyserver.ubuntu.com –recv-keys –homedir /tmp 9BDB3D89CE49EC21
    gpg –export –armor –homedir /tmp 9BDB3D89CE49EC21 | \
    sudo tee /etc/apt/trusted.gpg.d/mozilla.asc
    sudo chmod 0644 /etc/apt/trusted.gpg.d/mozilla.asc
    rm -f /tmp/pubring.kbx

    # install FF
    sudo apt-get update
    sudo apt-get install firefox firefox-locale-de

Leave a Reply

Your email address will not be published. Required fields are marked *