These instructions were written for Ubuntu installations without a browser, and can be fetched using curl with the following command:
curl https://iacot.it/firefox-apt.txt
Firefox from Mozilla’s APT repository — Ubuntu
This guide was last updated on 2026-09-17 against Mozilla’s Support Page.
Check upstream before trusting this: Mozilla has changed the keyring path and the APT pinning before, and this file is a copy, not the source. Verify the key fingerprint against the one published on that page.
This file exists because the Mozilla support page could not be fetched using curl or wget on a machine with no browser.
If these instructions are out of date, contact me via e-mail (me@iacot.it) or via Discord (onlyiaco).
1. Create a directory to store APT repository keys if it doesn’t exist:
sudo install -d -m 0755 /etc/apt/keyrings
2. Import the Mozilla APT repository signing key:
- Using wget:
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null - Using curl:
curl -fsSL https://packages.mozilla.org/apt/repo-signing-key.gpg | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
3. The fingerprint should be 35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3. Check it with the following command:
gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); if($0 == "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3") print "\nThe key fingerprint matches ("$0").\n"; else print "\nVerification failed: the fingerprint ("$0") does not match the expected one.\n"}'
4. Add the Mozilla APT repository to your sources.list:
- If you are on Ubuntu Noble (24.04) or older:
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 - If you are on Ubuntu Resolute (26.04) or newer:
sudo tee /etc/apt/sources.list.d/mozilla.sources > /dev/null << EOF Types: deb URIs: https://packages.mozilla.org/apt Suites: mozilla Components: main Signed-By: /etc/apt/keyrings/packages.mozilla.org.asc EOF
5. Configure APT to prioritize packages from the Mozilla repository:
sudo tee /etc/apt/preferences.d/mozilla > /dev/null << EOF
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000
EOF
6. Lower the priority of firefox from Ubuntu’s repositories:
sudo tee /etc/apt/preferences.d/firefox-ubuntu > /dev/null << EOF
Package: firefox
Pin: release o=Ubuntu
Pin-Priority: -1
EOF
7. Update your package list and install Firefox:
sudo apt-get update
- Install the latest version with:
sudo apt-get install firefox - Install the ESR version with:
sudo apt-get install firefox-esr - Install the beta version with:
sudo apt-get install firefox-beta - Install the nightly version with:
sudo apt-get install firefox-nightly - Install the devedition version with:
sudo apt-get install firefox-devedition