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.
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
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/null
Code language: JavaScript (javascript)
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)
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/null
Code language: PHP (php)
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/mozilla
Code language: PHP (php)
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
Finally, go ahead and install Firefox in the usual way by executing the following command:
sudo apt install firefox
Thatโs all! Once installed, you can launch it from the application menu. Type โfirefoxโย and click on the icon when it appears.
Firefox will start. Enjoy it!
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!