Completely Remove Snap from Ubuntu and Install Firefox as a DEB
This guide removes Snap from Ubuntu, prevents snapd from returning automatically, and installs Firefox from Mozilla's official APT repository.
1. Back Up Firefox
If you use the Firefox snap, its profile data is normally under:
~/snap/firefox/
Create a backup:
cp -a ~/snap/firefox ~/firefox-snap-backup
2. List Installed Snaps
snap list
Use the package names shown on your own system rather than blindly copying another machine's list.
3. Remove Snap Applications
Remove ordinary applications first:
sudo snap remove --purge firefox
sudo snap remove --purge snap-store
Remove other Snap applications as needed, such as Thunderbird.
Then remove desktop/content snaps if installed:
sudo snap remove --purge snapd-desktop-integration
sudo snap remove --purge gtk-common-themes
Remove GNOME platform snaps if present:
sudo snap remove --purge gnome-42-2204
Remove base snaps if present:
sudo snap remove --purge bare
sudo snap remove --purge core20
sudo snap remove --purge core22
sudo snap remove --purge core24
Finally, remove the snapd snap itself if it appears:
sudo snap remove --purge snapd
The general order should be:
Applications
↓
Desktop/content snaps
↓
GNOME platform snaps
↓
Base/core snaps
↓
snapd
4. Stop and Disable Snap Services
sudo systemctl disable --now snapd.service
sudo systemctl disable --now snapd.socket
sudo systemctl disable --now snapd.seeded.service
5. Remove Ubuntu's Firefox Transitional Package
On several Ubuntu releases, Ubuntu's Firefox DEB is a transitional package that redirects to the Snap package.
sudo apt purge firefox
6. Remove snapd
sudo apt purge snapd
sudo apt autoremove --purge
If installed, remove GNOME Software's Snap plugin:
sudo apt purge gnome-software-plugin-snap
7. Remove Leftover Snap Directories
sudo rm -rf /var/cache/snapd
sudo rm -rf /var/lib/snapd
sudo rm -rf /var/snap
sudo rm -rf /snap
rm -rf ~/snap
8. Prevent Snap From Being Reinstalled
sudo tee /etc/apt/preferences.d/99-no-snap.pref > /dev/null <<'EOF'
Package: snapd
Pin: version *
Pin-Priority: -10
EOF
Then:
sudo apt update
apt-cache policy snapd
9. Install Required Tools
sudo apt update
sudo apt install wget gnupg ca-certificates
sudo install -d -m 0755 /etc/apt/keyrings
10. Import 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
Mozilla's published fingerprint is:
35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3
Verify it:
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"}'
11. Add Mozilla's Repository
Check your Ubuntu release:
. /etc/os-release
echo "$VERSION_ID"
Ubuntu 22.04 and 24.04
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 > /dev/null
Ubuntu 26.04 and 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
12. Prioritize Mozilla's Firefox Package
sudo tee /etc/apt/preferences.d/mozilla-firefox.pref > /dev/null <<'EOF'
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000
Package: firefox
Pin: release o=Ubuntu
Pin-Priority: -1
EOF
13. Install Firefox
sudo apt update
apt-cache policy firefox
sudo apt install firefox
The candidate should come from packages.mozilla.org.
14. Verify Firefox Is Not a Snap
apt-cache policy firefox
firefox --version
command -v firefox
Normally, command -v firefox should return:
/usr/bin/firefox
15. Optional: Firefox Language Packs
For French:
sudo apt install firefox-l10n-fr
To list available language packs:
apt-cache search firefox-l10n
16. Optional: Replace Ubuntu App Center
Install GNOME Software without recommended Snap components:
sudo apt install --no-install-recommends gnome-software gnome-software-plugin-deb
For Flatpak support:
sudo apt install flatpak gnome-software-plugin-flatpak
--install-suggests here, because it may pull Snap integration back in on some Ubuntu releases.
17. Final Verification
command -v snap
dpkg -l | grep snapd
apt-cache policy snapd
apt-cache policy firefox
apt-cache policy firefox | grep packages.mozilla.org
18. Update Firefox Normally
sudo apt update
sudo apt upgrade
19. Restore Snap Later
sudo rm /etc/apt/preferences.d/99-no-snap.pref
sudo apt update
sudo apt install snapd