Ubuntu 24.04 installs Firefox as a snap by default, and even running the normal install command for Firefox quietly redirects you to that snap. Many users are happy with it, but others want the traditional .deb package for faster cold starts, better integration with some password managers and extensions, or simpler control over updates.
Mozilla provides an official .deb package through its own APT repository. This guide shows you how to back up your Firefox data, remove the snap cleanly, install the real .deb, and pin your system so Ubuntu never sneaks the snap back in.
Quick Answer
Back up your Firefox profile, remove the snap with sudo snap remove firefox, then add Mozilla’s official APT repository, install the firefox package from it, and set a high pin priority for Mozilla’s repository so it always wins over Ubuntu’s snap transition package. Finally, restore your profile data and confirm the new install with firefox --version and a quick launch test.
Before You Start: Back Up Your Firefox Profile
Your bookmarks, passwords, history, and extensions live in your Firefox profile, not in the program itself. Removing the snap deletes the snap’s copy of that profile, so a backup is essential if you want a seamless switch.
- Open Firefox and check it is signed in or that you know your saved logins are backed up.
- Close Firefox completely.
- Copy the snap profile folder to a safe place:
cp -r ~/snap/firefox/common/.mozilla/firefox ~/firefox-profile-backup - Confirm the backup exists:
ls ~/firefox-profile-backup - Optionally export bookmarks from the Library window as an HTML file as a second safety net.
If you use Firefox Sync, signing in on the new install will restore most data automatically, but a local backup protects you even if something goes wrong with sync.
Step 1: Remove the Firefox Snap
Removing the snap first avoids confusion between two Firefox installations with the same name.
- Close every Firefox window.
- Open a terminal with
Ctrl + Alt + T. - Remove the snap:
sudo snap remove firefox - Also remove Ubuntu’s transition package that forces the snap:
sudo apt remove firefox— if APT says it is not installed, that is fine. - Check the icon disappears from the app grid. It may take a few seconds.
Do not uninstall snapd itself. Other apps on Ubuntu 24.04, including the App Center, still rely on it, and removing it creates far bigger problems than the one you are solving.
Step 2: Add Mozilla’s Official APT Repository
Mozilla publishes its .deb packages through a signed repository. Adding it correctly means Firefox will update through your normal system updates.
- Create the keyrings folder if needed:
sudo install -d -m 0755 /etc/apt/keyrings - Download Mozilla’s 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 - Add the repository:
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee /etc/apt/sources.list.d/mozilla.list - Update your package lists:
sudo apt update - Confirm no errors mention the Mozilla repository. A clean update means the key and address are correct.
These steps follow Mozilla’s official installation instructions, which are also described on the Mozilla support page for installing Firefox on Linux. Always copy repository addresses from Mozilla’s own pages rather than random forum posts.
Step 3: Pin the Mozilla Repository So It Always Wins
This is the step people skip — and the reason Firefox mysteriously becomes a snap again after an update. Ubuntu’s own firefox package is a wrapper that installs the snap. APT pinning tells your system to prefer Mozilla’s real package.
- Create a preferences file:
sudo nano /etc/apt/preferences.d/mozilla - Paste these lines into the file:
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000 - Save with
Ctrl + O, press Enter, and exit withCtrl + X. - Run
sudo apt updateagain. - Check which candidate APT will install:
apt-cache policy firefox - The candidate should show Mozilla’s repository address, not Ubuntu’s. If it does, your pin is working.
A priority of 1000 is deliberately strong. It guarantees Mozilla’s package is chosen even when Ubuntu’s repositories offer a version with a higher number, which would otherwise be the snap wrapper in disguise.
Step 4: Install the Firefox .deb Package
Now install Firefox the traditional way:
- Install the package:
sudo apt install firefox - Watch the output. It should download from packages.mozilla.org, not mention installing snapd or a snap transition.
- Verify the version:
firefox --version - Confirm the binary is a normal system program:
which firefoxshould point to/usr/bin/firefox. - Launch Firefox from the app grid and time the first start. It should feel like any other regular application.
To double-check you are not running the snap, run snap list and confirm Firefox no longer appears there. If it does, the snap was not fully removed; close Firefox and repeat Step 1. Our general guide on managing Ubuntu updates from the terminal will also help you keep this new install current through normal system updates.
Step 5: Restore Your Profile Data
If you did not use Firefox Sync, restore your backup so the new install feels like home.
- Launch the new Firefox once, then close it completely. This creates the new profile folders.
- Find the new profile location:
ls ~/.mozilla/firefox - Copy your backed-up profile contents into the new default profile folder, replacing files when asked:
cp -r ~/firefox-profile-backup/*.default* ~/.mozilla/firefox/— adjust the folder names to match what you actually see. - Alternatively copy the whole folder and point Firefox to it with the Profile Manager:
firefox -P - Open Firefox and verify bookmarks, saved logins, and extensions are present.
- Keep the backup folder for a week before deleting it, just in case.
Profile folder names vary between systems, so work carefully and never paste a command with a folder name you have not checked exists on your own machine.
Step 6: Set Firefox as Default and Tidy Up
- Open Settings, go to Default Applications, and set Web to Firefox if needed.
- Open any saved desktop shortcuts and confirm they launch the new version.
- Pin the new Firefox icon to the dock if you used to have it pinned.
- Run a final system update:
sudo apt update && sudo apt upgradeand confirm Firefox is not replaced.
Common Mistakes and Useful Tips
- Skipping the pin: Without the APT pin, a future update can reinstall Ubuntu’s wrapper package and bring the snap back. This is the single most common reason the switch does not stick.
- Forgetting the profile backup: Removing the snap removes its profile copy. Rebuilding bookmarks and logins from memory is painful; the backup takes less than a minute.
- Installing a random .deb from the web: Only use Mozilla’s repository. A one-off downloaded file will not receive automatic updates, leaving your browser insecure over time.
- Removing snapd entirely: Ubuntu 24.04 still needs snapd for other components. Removing only the Firefox snap is the correct, surgical approach.
- Tip — verify after big system upgrades: After a major Ubuntu release upgrade, run
apt-cache policy firefoxonce to confirm Mozilla’s repository is still the chosen source. - Tip — keep the official instructions handy: The Mozilla APT repository page is the authoritative reference if package names or repository details ever change.
Conclusion
Replacing the Firefox Snap with the .deb on Ubuntu 24.04 is a clean, reversible process when you follow the order: back up your profile, remove the snap, add Mozilla’s official repository, pin it with priority 1000, and then install. The pin is what makes the change permanent, and the backup is what makes it painless. Afterwards Firefox updates through your normal system updates, starts like a traditional application, and stays exactly where you put it.
Frequently Asked Questions
Will Firefox still update automatically as a .deb?
Yes. Because you added Mozilla’s APT repository, Firefox updates arrive through Software Updater and sudo apt upgrade just like your other system packages, usually within a day or two of a Mozilla release.
Why did Firefox turn back into a snap after I installed the .deb once before?
Almost certainly the APT pin was missing. Ubuntu’s wrapper package won during an update and installed the snap again. Add the pin with priority 1000 for packages.mozilla.org and the problem stops.
Can I keep both the snap and the .deb installed?
It is technically possible but strongly discouraged. Two Firefoxes cause confusion with default browser settings, profiles, and icons. Choose one — for most people following this guide, the .deb alone is the right setup.
Does removing the Firefox snap affect other snap apps?
No. Each snap is independent. Removing Firefox leaves the App Center, firmware updater, and any other snaps untouched and fully functional.
How do I go back to the snap version if I change my mind?
Remove the pin file, uninstall the .deb with sudo apt remove firefox, then install the snap with sudo snap install firefox. Your profile in ~/.mozilla stays in place, and you can copy it back to the snap profile location if needed.


Leave a Reply