Ubuntu’s default firefox package installs the Snap build, so removing Firefox on Ubuntu needs a profile check before package removal. To remove Firefox Snap from Ubuntu without losing browser data, back up or migrate the Snap profile before using snap remove --purge. Stop after the removal check if you only want Firefox gone; use Mozilla’s official APT repository if you want Firefox back as a deb package.
Remove Firefox Snap From Ubuntu
The removal-only path is short, but the profile step matters. Firefox Snap stores user profiles under ~/snap/firefox/common/.mozilla/firefox, while deb-packaged Firefox uses ~/.mozilla/firefox.
This removes only the Firefox Snap package. It does not remove snapd, the Snap Store, cached revisions for other snaps, or unrelated Snap applications.
The
--purgeoption removes the snap without saving a recovery snapshot of its data. If you want to keep bookmarks, passwords, history, extensions, or profiles from the Snap build, copy the profile before running the removal command.
Migrate the Firefox Snap Profile
Close Firefox first, then copy the Snap profile into the native Firefox profile location:
if [ -d ~/snap/firefox/common/.mozilla/firefox ]; then
mkdir -p ~/.mozilla
cp -a ~/snap/firefox/common/.mozilla/firefox ~/.mozilla/
fi
If you only want a backup and do not plan to install the Mozilla APT build, copy the same directory to a backup folder instead of ~/.mozilla/.
Remove the Firefox Snap Package
Remove the Snap package after saving any profile data you want to keep:
These commands use
sudofor snap and package changes. If your account cannot run administrative commands yet, create or switch to a sudo-capable user with the Ubuntu sudoers setup guide before continuing.
sudo snap remove --purge firefox
Confirm that the Firefox Snap is gone:
snap list firefox 2>/dev/null || echo "Firefox snap is not installed"
A removed Snap should return:
Firefox snap is not installed
Review Firefox Snap and Mozilla APT Trade-offs
Mozilla’s APT repository gives Firefox back to APT, but it also changes the update path and confinement model. Before replacing the browser, decide what should own updates, profiles, and package isolation:
| Area | Firefox Snap | Firefox deb from Mozilla APT |
|---|---|---|
| Install source | Ubuntu’s transitional firefox package installs the Snap Store build | Mozilla’s official packages.mozilla.org APT repository |
| Updates | Handled by snapd | Handled by APT after the Mozilla source and priority pin are configured |
| Profile path | ~/snap/firefox/common/.mozilla/firefox | ~/.mozilla/firefox |
| Desktop integration | Snap confinement can affect themes, portals, and file access | Uses the traditional deb package layout and desktop integration |
| Isolation | Snap confinement provides an extra packaging sandbox | Uses the normal Ubuntu desktop security stack without Snap confinement |
Ubuntu 26.04 LTS, 24.04 LTS, and 22.04 LTS use the same Mozilla APT setup here. The Mozilla APT repository is not a PPA; if you previously used
ppa:mozillateam/ppa, remove that source before adding Mozilla’s official repository so APT does not see two Firefox providers.
Install Firefox From Mozilla’s Official APT Repository
Mozilla recommends its official APT repository for Debian-based and Ubuntu-based distributions. This path replaces Ubuntu’s Snap transition package with Mozilla’s deb package, then pins APT so future installs and upgrades keep selecting packages from packages.mozilla.org.
Clean Up Legacy Mozilla Team PPA Entries
Skip this cleanup if you never used the old Launchpad PPA. If a previous Firefox replacement setup added ppa:mozillateam/ppa, remove that source before adding Mozilla’s official repository:
sudo add-apt-repository --remove ppa:mozillateam/ppa
sudo rm -f /etc/apt/preferences.d/mozillateam-firefox
sudo rm -f /etc/apt/apt.conf.d/51unattended-upgrades-firefox
sudo apt update
If add-apt-repository is not available or APT reports duplicate source settings, use the PPA removal guide for Ubuntu to inventory and remove the old Launchpad files safely.
Install Repository Tools
Install the HTTPS and signing-key tools used to fetch Mozilla’s repository key. These packages are present on many Ubuntu desktops, but installing them explicitly keeps the repository setup predictable on minimal systems:
sudo apt update
sudo apt install ca-certificates wget gpg -y
Download Mozilla’s APT Signing Key
Download Mozilla’s signing key to a local file first. The next check verifies the fingerprint before the key is installed into APT’s trusted keyring path:
rm -f packages.mozilla.org.asc
wget -O packages.mozilla.org.asc https://packages.mozilla.org/apt/repo-signing-key.gpg
Check the downloaded key fingerprint before APT consumes the repository. Mozilla publishes this fingerprint for the repository signing key:
tmp_gnupg="$(mktemp -d)"
GNUPGHOME="$tmp_gnupg" gpg --quiet --show-keys --with-colons --fingerprint packages.mozilla.org.asc | awk -F: '$1 == "fpr" { print $10; exit }'
rm -rf "$tmp_gnupg"
35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3
If the fingerprint differs, delete packages.mozilla.org.asc, download the key again, and do not continue until the value matches.
After the fingerprint matches, install the key into the APT keyring directory:
sudo install -d -m 0755 /etc/apt/keyrings
sudo install -m 0644 packages.mozilla.org.asc /etc/apt/keyrings/packages.mozilla.org.asc
rm -f packages.mozilla.org.asc
Add the Mozilla APT Repository
Create the Mozilla source as a DEB822 file. The Signed-By field limits the key to this repository instead of trusting it globally:
printf '%s\n' \
'Types: deb' \
'URIs: https://packages.mozilla.org/apt' \
'Suites: mozilla' \
'Components: main' \
'Signed-By: /etc/apt/keyrings/packages.mozilla.org.asc' \
| sudo tee /etc/apt/sources.list.d/mozilla.sources > /dev/null
Prioritize Mozilla APT Packages
Ubuntu’s repositories still provide a firefox transition package that installs the Snap build. Mozilla recommends pinning packages from packages.mozilla.org at priority 1000 so APT selects Mozilla packages when both sources provide Firefox:
printf '%s\n' \
'Package: *' \
'Pin: origin packages.mozilla.org' \
'Pin-Priority: 1000' \
| sudo tee /etc/apt/preferences.d/mozilla > /dev/null
This pin covers Firefox stable and related Mozilla Firefox channel packages from the same repository. Keep it in place while you want APT to prefer Mozilla’s deb packages over Ubuntu’s Snap transition package.
Install Firefox From Mozilla APT
Refresh package metadata and install Firefox from Mozilla’s repository. The downgrade allowance is intentional because Ubuntu’s Snap transition package uses an epoch version such as 1:1snap1, which APT treats as higher than Mozilla’s normal Firefox version:
sudo apt update
sudo apt install --allow-downgrades firefox
Review the transaction before confirming. A clean replacement should downgrade only the firefox transition package to Mozilla’s Firefox package, not remove unrelated desktop packages.
Verify Firefox Uses Mozilla APT
Check the selected package source. The candidate should come from https://packages.mozilla.org/apt, and the installed version should no longer be Ubuntu’s 1:1snap1 transition package:
apt-cache policy firefox
Confirm the installed package version without launching Firefox:
dpkg-query -W -f='${Version}\n' firefox
A Mozilla repository build uses a normal Firefox version string ending in a build suffix such as ~build1. If the version still begins with 1:1snap1, APT is still using Ubuntu’s Snap transition package.
Troubleshoot Firefox Snap Replacement
Most failures come from the Snap transition package still winning APT selection, an old PPA source still being enabled, an omitted downgrade allowance, or a profile copied after purge instead of before it.
Firefox Still Asks for the Snap Package
If running firefox still asks you to install the Snap package, Ubuntu’s transitional wrapper is still being used instead of Mozilla’s deb package:
Command '/usr/bin/firefox' requires the firefox snap to be installed. Please install it with: snap install firefox
Check the selected package source:
apt-cache policy firefox
If the installed or candidate version begins with 1:1snap1, re-create the Mozilla source and priority pin above, then reinstall Firefox with --allow-downgrades.
APT Refuses to Replace the Snap Package
If you use -y without allowing the transition package downgrade, APT can stop with this error:
Error: Packages were downgraded and -y was used without --allow-downgrades.
Run the install command with the downgrade flag and review the transaction before confirming:
sudo apt install --allow-downgrades firefox
Snap Reports a Remove Change in Progress
If snap remove reports that Firefox already has a remove-snap change in progress, inspect the Firefox change before retrying. The snap stop command is for snap services, not normal Firefox browser windows, so close Firefox from the desktop or log out before retrying the removal.
snap changes firefox
snap tasks CHANGE-ID
Replace CHANGE-ID with the ID from the Firefox row in snap changes firefox. If that Firefox remove task is clearly stuck and no other snap install, refresh, or remove operation is running, abort that specific change and run the Firefox removal again:
sudo snap abort CHANGE-ID
sudo snap remove --purge firefox
Firefox Snap Returns After an Ubuntu Upgrade
If Firefox Snap returns after a major Ubuntu upgrade, the upgrade may have disabled the Mozilla source or restored Ubuntu’s transition package. Re-check the Mozilla source and pin files, refresh APT, then reinstall the Mozilla package:
grep -RIn "packages.mozilla.org" /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null
cat /etc/apt/preferences.d/mozilla
sudo apt update
sudo apt install --allow-downgrades firefox
Firefox Opens With a New Profile
If Firefox opens with a blank profile, check whether the old Snap profile still exists:
find ~/snap/firefox/common/.mozilla/firefox -maxdepth 1 \( -name "*.default*" -o -name "*.default-release*" \) 2>/dev/null
If the command returns profile folders, close Firefox and copy them into the native profile directory:
mkdir -p ~/.mozilla
cp -a ~/snap/firefox/common/.mozilla/firefox ~/.mozilla/
If the Snap profile directory no longer exists after a purged removal, restore the profile from your own backup or Firefox Sync. The --purge removal path does not keep a snap recovery snapshot.
Mozilla Package Is Not Found
If APT cannot find Mozilla’s Firefox package, check whether the official Mozilla source exists:
grep -RIn "packages.mozilla.org" /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null
If the command returns nothing, re-run the Mozilla repository setup commands above, then refresh package metadata:
sudo apt update
apt-cache policy firefox
Old Mozilla Team PPA Still Appears
If APT still shows ppa.launchpadcontent.net/mozillateam/ppa, remove the old PPA before troubleshooting the official Mozilla source. Keeping both can make Firefox source selection harder to reason about:
grep -RIn "mozillateam" /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null
Use the legacy cleanup commands near the Mozilla repository setup section. If APT reports duplicate or conflicting source entries, inventory the old Launchpad files before changing the Mozilla source.
Restore Firefox Snap on Ubuntu
To revert, remove Mozilla’s deb package, remove the Mozilla source and pin files, refresh APT, and install Ubuntu’s default Firefox package again. That default package reinstalls the Firefox Snap through Ubuntu’s transition package.
If the old Mozilla Team PPA is still enabled, clean up that Launchpad source before restoring Ubuntu’s default Firefox package so APT does not select the wrong provider.
sudo apt remove --purge firefox
sudo rm -f /etc/apt/preferences.d/mozilla
sudo rm -f /etc/apt/sources.list.d/mozilla.sources
sudo rm -f /etc/apt/keyrings/packages.mozilla.org.asc
sudo apt update
sudo apt install firefox
Review optional orphan cleanup separately instead of pasting a blind autoremove command:
sudo apt autoremove --dry-run
If the preview only lists packages you no longer need, run sudo apt autoremove and review the confirmation prompt before accepting.
Verify the Snap build is back:
snap list firefox
The output should show a firefox row from the verified mozilla** publisher. Version and revision values change as the Snap Store updates Firefox.
apt-cache policy firefox
The APT policy should again show Ubuntu’s 1:1snap1 transition package as the installed Firefox package.
Conclusion
Firefox now either stays removed from Ubuntu or runs from Mozilla’s official APT repository with the Snap transition package out of the active path. For alternate Mozilla channels, install Firefox Developer Edition on Ubuntu, use Firefox Beta or Nightly on Ubuntu, or choose Firefox ESR on Ubuntu when you prefer extended-support browser releases.


Nils (@ravage:xentonix.net on Matrix) used to have a great script to do not only this, but also export and import all one’s settings: open pages, passwords, and whatnot.
It would be great if someone could recreate that.
He is in the Ubuntu discussions on Matrix (https://matrix.to/#/#support:ubuntu.com), but no longer has the script.
Firefox sync does this.