
When you install Firefox from the Mozilla's official repository on Ubuntu And if you uninstall the Snap version, logically everything should stay that way forever. But many users encounter the same surprise: after restarting the system or installing updates, Firefox reappears in Snap format As if nothing had happened. If this has happened to you several times, it's not because you're doing anything wrong: it's Ubuntu's default behavior if APT and package priorities aren't configured correctly.
In this article we'll see step by step how Install Firefox from the official Mozilla APT repository on UbuntuHow to uninstall any trace of the Snap package and, above all, how to prevent the system from bringing it back in future updates. The idea is that, in the end, you'll be left with a Firefox .deb package well integrated into the system, respecting things like cursor themes, GTK themes, and appearanceand without having to deal with daily Snap reinstallations.
Why does Ubuntu insist on installing Firefox as a Snap?
From Ubuntu 22.04 LTS onwards, Canonical has made a strong commitment to the Snap packages for desktop applicationsAnd Firefox is one of the clearest examples. In these versions, the firefox package from the official Ubuntu repository is basically a empty transition package which simply installs the Firefox Snap. So, even though you see it as a normal .deb file, what actually gets executed is the Snap package.
This means that if you install Firefox .deb from another source (for example, the official Mozilla repositoryand you don't change APT's priorities, as soon as there are updates or the system thinks it needs to "fix" dependencies, Reinstall the Firefox package from UbuntuAnd with it, Snap. That's why you keep encountering Firefox in Snap format after every system restart or full update.
In addition, many users notice that Firefox Snap has certain annoying side effects such as problems with custom icon themes or cursorsPoorer integration with some desktop themes, slightly slower startup times, and some odd permission issues. That's why more and more people are preferring Use the traditional Firefox .debeither from the Mozilla Team PPA or, more cleanly and directly, from the official Mozilla APT repository.
Options for using Firefox .deb on Ubuntu
In Ubuntu you have two main paths to have Firefox in .deb format without relying on Snap. Both are valid, but it's important to understand what each one does to avoid mixing configurations that may later conflict.
The first option is use the PPA "mozillateam" (LP-PPA-mozillateam). This PPA has been the go-to source for the latest version of Firefox for years, as well as ESR and Thunderbird versions In .deb format. It allows for quick updates, is usually ahead of the Ubuntu repositories, and integrates very well with the system. However, if you use it, you must set APT priorities to prevent the Ubuntu Firefox (which uses Snap) from sneaking in again.
The second option, more recent and highly recommended, is to add the Mozilla's official APT repository (packages.mozilla.org). With this method, Firefox comes directly from Mozilla, without intermediaries, in .deb format, and you can configure APT to always prefer this origin compared to any other repository for Firefox packages. Furthermore, this repository is already the one Mozilla officially documents as the way to install Firefox on Ubuntu and other Debian-based distributions.
First of all: clean up Firefox Snap and any previous remnants
Before we get into the installation from the official Mozilla repository, it is essential Remove any trace of Firefox Snap And, if you've used it, also clean up the Mozilla Team PPA and its priority rules. This cleanup prevents conflicting package sources and avoids ending up with a mess of different versions.
If you currently have Firefox installed from the Official Ubuntu SnapThe first step is to completely uninstall it from the terminal. To do this, open a console and run:
sudo snap remove firefox
In some cases, it's a good idea to add the purge option so that data and settings managed by Snap are also deleted, so you can use snap remove –purge firefox If you want to do an even deeper cleaning of the Snap package and its residue.
In Ubuntu 22.04 and later versions, in addition to Snap, you may have the following installed: Firefox transition pack from APT, which actually only serves as a container for the Snap. To remove it and prevent APT from using it as a bridge to reinstall the Snap, run:
sudo apt remove --autoremove firefox
If the system responds that there is nothing to remove, that's fine; it means that package was no longer installed. The important thing is to make sure that Make sure there are no Ubuntu Firefox .deb files pointing to the Snapbecause that's precisely what can reactivate the installation of the Snap package in future updates.
How to disable the Mozilla Team PPA if you've used it before
If you previously had Firefox installed from the mozillateam PPAIt's best to get everything in order before switching to the official Mozilla repository. Maintaining both sources simultaneously is possible, but it can confuse APT with priorities and versions, so the cleanest approach is to choose just one.
To remove the mozillateam PPA from your system, run the following command in the terminal, which removes the software source:
sudo add-apt-repository -r ppa:mozillateam/ppa
In addition to the PPA itself, you likely have an APT preferences file that prioritizes this repository. It's usually located in /etc/apt/preferences.d/mozilla-firefox or a similar name. To remove it without leaving a trace, you can do the following:
sudo rm -rf /etc/apt/preferences.d/mozilla-firefox
Some tutorials also recommend creating a file like /etc/apt/preferences.d/99mozillateamppaIf you have a file with that name, review its contents or delete it if you no longer want to rely on the mozillateam PPA. This will remove any outdated rules that might interfere with the official Mozilla repository.
Install Firefox from the official Mozilla APT repository
With the field now cleared of old Snaps and PPAs, it's time to Add the official Mozilla repository To install Firefox in .deb format. This method works perfectly on Ubuntu 24.04 LTS and also on earlier versions compatible with modern APT.
Create the directory for APT keys (if it does not exist)
APT repository signing keys are usually stored in /etc/apt/trusted.gpg.dAlthough some tutorials recommend creating a specific directory to group external provider keys, if the directory already exists, you don't need to do anything; otherwise, you can create it with:
sudo mkdir -p /etc/apt/trusted.gpg.d
This step guarantees that you will have a suitable place to store the Mozilla signature keywhich is essential for APT to trust the packages it downloads from the new repository.
Import the signing key from the Mozilla repository
The next step is to add the Mozilla APT repository official GPG keyThis key allows you to verify that the downloaded packages actually come from Mozilla and haven't been tampered with. You can do this using wget from the terminal like this:
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/trusted.gpg.d/packages.mozilla.org.asc > /dev/null
If your system does not have wget installedYou can add it first with a simple sudo apt install wgetOnce the key is imported, APT will be able to authenticate packages arriving from packages.mozilla.org without displaying unknown signature warnings.
Add the Mozilla APT repository to the list of sources
With the key now installed, it's time to incorporate the Mozilla package repository to your software origins. You can do this in two ways: from the graphical interface of "Programs and Updates" or directly by editing files in the terminal.
If you prefer the graphical route, open «Programs and updatesGo to the "Other Software" tab and click "Add". In the text box, enter the following complete line from the repository and save the changes:
deb https://packages.mozilla.org/apt mozilla main
If you want to do it via terminal, you can also create a new file in /etc/apt/sources.list.d with that line inside, using, for example, your favorite text editor. The important thing is that APT knows the source exists. https://packages.mozilla.org/apt with the "mozilla main" section.
Configure APT to prioritize the Mozilla repository and block the Snap
The key point to prevent Firefox Snap from reinstalling is Configure APT priorities correctlySimply adding the Mozilla repository is not enough; you must tell the system to always prefer that source for Firefox and, furthermore, to reject Firefox packages from Ubuntu repositories that lead to Snap.
To do this robustly, it is recommended to create a preferences file in /etc/apt/preferences.d that includes two blocks: one giving maximum priority to packages.mozilla.org and another assigning a negative priority to the Ubuntu Firefox. You can do this in a single command using `echo` and `tee`, without copying line by line, like this:
echo 'Package: * Pin: origin packages.mozilla.org Pin-Priority: 1000 Package: firefox* Pin: release o=Ubuntu Pin-Priority: -1' | sudo tee /etc/apt/preferences.d/mozilla
The first block indicates that any package originating from packages.mozilla.org It has priority 1000, which, in practice, means APT always chooses it over other sources with the same package version. The second block tells APT that packages whose name begins with firefox and come from Ubuntu repositories They have priority -1, meaning they should not be installed automatically.
With this setup you kill two birds with one stone: You ensure that Firefox is installed and updated from the official Mozilla repository. And at the same time, you prevent Ubuntu from reinserting its Snap-associated transition package when you perform a general system upgrade.
Update indexes and install Firefox from Mozilla
After adding the repository and adjusting the preferences, you can now tell APT to update the list of available packages and proceed with a clean installation of Firefox, this time from packages.mozilla.orgTo ensure that no previous residue remains, you can do a small purge beforehand.
Start by removing any previous Firefox .deb installations that may remain, along with their APT translations, using:
sudo apt purge firefox sudo apt purge firefox-locale-es sudo apt autoremove
This ensures that both the browser and the Spanish language pack associated with previous sources (Ubuntu or PPA) are deleted. Your personal Firefox data (profile, bookmarks, passwords) is usually stored in your user directorySo you don't normally lose them when you purge the package, but it's always a good idea to have a backup just in case.
Now update the package information and apply any pending updates to other components, so that everything is synchronized before installing the new Firefox:
sudo apt update sudo apt upgrade
Once you've done this, you can install the browser and, if you wish, the Spanish localization package directly from the official Mozilla repository. Run:
sudo apt install firefox sudo apt install firefox-l10n-es-es
If APT preferences are configured correctly, APT will choose the Firefox from packages.mozilla.org instead of any other available version. From now on, future Firefox updates will come from the Mozilla repository when they release new versions, without the Ubuntu Snap being used again.
Alternative: Use the Mozilla Team PPA with specific pinning.
If you prefer to continue using the PPA Mozilla Team Instead of the official Mozilla repository, you can also use an updated Firefox .deb file and prevent the system from reverting to the Ubuntu Snap. It's a slightly different method, but equally valid for those who already rely on that PPA or also use it for Thunderbird.
To add this PPA, open a terminal and run the following command, which will add the source to your system and update the indexes:
sudo add-apt-repository ppa:mozillateam/ppa -y
After adding it, it's a good idea to refresh the repositories and install basic updates to ensure everything is aligned with the new PPA versions. You can do this with:
sudo apt update sudo apt upgrade
If your system requires it, you can also use a sudo apt full upgrade to apply more profound changes, although it is advisable to review them beforehand in case they affect other critical packages outside of Firefox or Thunderbird.
To force APT to always use the Firefox from this PPA and block the Ubuntu version, create a preferences file similar to the Mozilla repository's, but pointing to LP-PPA-mozillateam. For example, you could use nano to do the following:
sudo nano /etc/apt/preferences.d/99mozillateamppa
Within that file, two blocks are typically used: one to enforce the preference for the Mozilla Team PPA and another to block Firefox from the Ubuntu repository. A typical example would be:
Package: firefox* Pin: release o=LP-PPA-mozillateam Pin-Priority: 501 Package: firefox* Pin: release o=Ubuntu Pin-Priority: -1
The first block tells APT that the Firefox from the mozillateam PPA It must take priority over the official repositories. The second block explicitly blocks the Ubuntu Firefox package, which is the one that usually redirects to the Snap. This prevents the system from trying to revert to that transitional package when you perform general updates.
To install Firefox from this PPA with the Spanish language, it's common to use a command that specifies the corresponding source, so there's no doubt about which repository is being used. For example:
sudo apt install -t 'o=LP-PPA-mozillateam' firefox firefox-locale-es
From then on, Firefox will update to new versions as the PPA team uploads them, usually quite quickly. This method has been tested on distributions such as Ubuntu and Kubuntu 22.04 or 22.10, and many users also use it to have Thunderbird and Firefox ESR in .deb format.
Advantages of using Firefox .deb versus the Snap package
Beyond the technical aspects of repositories and priorities, many users are looking for the Firefox .deb instead of Snap for reasons of integration and a sense of fluidity. A very specific case is that of those who want to preserve or correctly apply custom cursor themesThis is something that may not be respected in the same way with Snap, precisely because of the isolation inherent in this type of package.
.deb packages are generally better integrated with the desktop theme, icons, system settings and other elements, because they share the same library environment and typical distribution paths. They also tend to boot somewhat faster and behave more predictably when using system extensions or external integrations.
In contrast, Snaps have advantages in terms of isolation, packaged dependencies, and ease of offering the same application across multiple distributions, but in practice, as things stand today, They haven't quite convinced a large part of the community of Ubuntu users on the desktop. That's why it's not surprising that people want to replace Firefox Snap with a traditional .deb file maintained either directly by Mozilla or by the Mozilla Team.
Following all these steps, from completely removing the Snap to configuring APT with appropriate priorities and repositoriesYou can maintain a fully functional and up-to-date Firefox .deb on Ubuntu without the system reinstalling the Snap package every time you shut down your computer or accept updates. The key is to clean up old sources, correctly set the pinning, and choose whether you prefer the Mozilla's official repository or the mozillateam PPAKnowing that in both cases you avoid the Ubuntu transition package that forces the use of Snap.