How to Install the Latest (Non-ESR) Firefox on Debian 12

Learn how to install the most recent Firefox on Debian 12 (Bookworm) from Mozilla's official repository for up-to-date browsing.

Debian stands out as one of the top choices and most esteemed Linux distributions, thanks to its more than 30 years of delivering proven stability and reliability. However, its conservative approach means it often includes older software versions.

This is particularly evident with the Firefox in Debian’s 12 Bookworm release, where the browser is offered in its 115 ESR (Extended Support Release) version.

Firefox ESR on Debian 12
Firefox ESR on Debian 12

Unlike the standard version of Firefox, which receives frequent updates and new features, the ESR version is updated less frequently and focuses on stability and security updates.

But what if you’re running Debian 12 as a workhorse for your daily computing needs and are looking to keep Firefox as current as possible? Well, we’ve got good news – you’re in the right place!

We’re here to guide you through installing the most up-to-date Firefox version on Debian 12 Bookworm, ensuring you follow the best practices at every step. So, let’s dive in!

Remove Old (ESR) Firefox Version

First, let’s uninstall the old Firefox version from our Bookworm system, which is quite simple. Open your terminal app and run the following command:

sudo apt purge firefox-esr
Remove the old (ESR) Firefox version.
Remove the old (ESR) Firefox version.

It’s time to say goodbye to Firefox ESR and move on to installing the latest version of the browser.

Install the Latest Firefox on Debian 12

Mozilla recently launched an official repository for Debian and Debian-based distros, providing the ability to download and install the latest version of the Firefox browser. This is a great option that we will use in the current guide.

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, 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)
Download the Mozilla repo's key.
Download the Mozilla repo’s 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 Mozilla repoโ€™s key.
Import Mozilla repoโ€™s key.

You should get the fingerprint โ€œ35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3,โ€ which guarantees you that the key youโ€™ve imported is authentic.

Add the Firefox Repo to your Debian 12 System

Now, it’s time to add Mozilla’s official repository, which hosts the DEB packages we need to install Firefox, to our Bookworm system. The command below (again) will not 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 Debian 12.
Add the Firefox repo to Debian 12.

Prioritize Mozillaโ€™s Repo

Let’s take a moment to understand why we should prioritize the new Mozilla repository we’ve added and what this really involves. In Debian, 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 official Debian one. So, if you try to install the browser now, the system will fetch it from the Debian repository, and you’ll end up with the ESR version (again) installed on your system.

We’ll use a “pinning” mechanism in APT to avoid this. 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 over Debian's one.
Prioritize Mozillaโ€™s repo over Debian’s one.

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 Debian 12 Bookworm

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

sudo apt update
Refresh packages index.
Refresh packages index.

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

sudo apt install firefox
Install the latest Firefox on Debian 12 Bookworm.
Install the latest Firefox on Debian 12 Bookworm.

Thatโ€™s all! Once installed, you can launch it from the application menu. Type โ€œfirefoxโ€ย and click on the icon when it appears.

Launching Firefox web browser.
Launching Firefox web browser.

Firefox will start. Enjoy it!

The latest Firefox runs ะพn Debian 12.
The latest Firefox runs ะพn Debian 12.

Conclusion

Upgrading to the latest version of Firefox on Debian 12 Bookworm is straightforward and ensures you have access to the newest features, security patches, and improvements Mozilla offers.

This guide has meticulously walked you through each step, from removing the not-so-new Firefox ESR to importing Mozilla’s repository key, adding the Firefox repo, and finally, installing the latest browser version.

Each step is designed to ensure you follow best practices, ensuring a seamless and efficient upgrade process.

With the latest Firefox installed, you can enjoy a faster, more secure, and feature-rich browsing experience on your Debian 12 system. Happy browsing!

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%