Skip to content

Instantly share code, notes, and snippets.

@seancrites
Forked from jfeilbach/firefox_snap.md
Last active March 19, 2026 02:57
Show Gist options
  • Select an option

  • Save seancrites/1121c112f57e8a8f4bcbcb9fd212c998 to your computer and use it in GitHub Desktop.

Select an option

Save seancrites/1121c112f57e8a8f4bcbcb9fd212c998 to your computer and use it in GitHub Desktop.
Debian/Ubuntu 24.04+ remove Firefox snap and install Mozilla .deb version

Debian/Ubuntu 24.04+ Firefox snap replacement

Why?

  1. Better Integration with System

    • Apt: Firefox installed via apt integrates seamlessly with Debian/Lubuntu’s native theming, fonts, and desktop environment (e.g., LXQt for Lubuntu). It respects system-wide settings for GTK themes and file associations.
    • Snap: Snap’s sandboxing can cause inconsistencies, like mismatched themes or issues with file dialogs, as it uses its own libraries. This can feel clunky in lightweight environments like Lubuntu.
  2. Faster Startup and Performance

    • Apt: Firefox from apt runs natively, leveraging shared system libraries, which reduces memory overhead and speeds up launch times, especially on resource-constrained systems.
    • Snap: Snap packages are containerized, including dependencies, which increases disk usage and can slow startup due to decompression and sandbox overhead. This is noticeable on older hardware or minimal setups.
  3. Simpler Dependency Management

    • Apt: Uses Debian’s package manager, ensuring dependencies are shared across applications and updated centrally via apt update && apt upgrade. This keeps your system lean and consistent.
    • Snap: Bundles dependencies, which can lead to redundant libraries and larger disk footprints. Snap updates are managed separately, complicating system maintenance and potentially causing version mismatches.
  4. Avoiding Snap’s Auto-Update Behavior

    • Apt: You control when Firefox updates using apt, aligning with your system update schedule. This is critical for environments where stability is prioritized, like in your role at Alaska Communications.
    • Snap: Snap enforces automatic background updates, which can introduce unexpected changes or consume bandwidth at inconvenient times, potentially disrupting workflows or testing environments.
  5. Greater Customization and Control

    • Apt: Installing via apt allows easier access to system-level configurations, such as modifying Firefox’s binary or integrating with custom scripts. It also supports direct installation of ESR (Extended Support Release) versions for long-term stability.
    • Snap: The sandboxed nature of Snap restricts access to certain system paths and complicates custom configurations. It may also limit compatibility with extensions or tools that expect a native installation.

Remove Snap Firefox, if it's already installed

sudo snap disable firefox
sudo snap remove --purge firefox
error: cannot perform the following tasks:
- Remove data for snap "firefox" (1943) (unlinkat /var/snap/firefox/common/host-hunspell/en_ZA.dic: read-only file system)

If you get this error verify that /var/snap/firefox/common/host-hunspell is mounted as an ext4 file system using lsblk -fe7 -o+ro

sudo systemctl stop var-snap-firefox-common-host\\x2dhunspell.mount
sudo systemctl disable var-snap-firefox-common-host\\x2dhunspell.mount
Removed /etc/systemd/system/default.target.wants/var-snap-firefox-common-host\x2dhunspell.mount.
Removed /etc/systemd/system/multi-user.target.wants/var-snap-firefox-common-host\x2dhunspell.mount.

If this fails you might be able to do this...

sudo umount /var/snap/firefox/common/host-hunspell
sudo snap disable firefox

Skip this step this step, or do not '--purge' if you want to import your current Firefox profiles.

sudo snap remove --purge firefox

You will probably have leftover files in /var/lib/snapd/seed/snaps from the default Firefox install. You can manually remove them. I don't think there is a snap comand that will remove just the Firfox files. Be careful deleting stuff in this directory especially if you are stil using other snaps besides Firefox. You've been warned.

Block future snap Firefox installs

sudo vi /etc/apt/preferences.d/firefox-no-snap
Package: firefox*
Pin: release o=Ubuntu*
Pin-Priority: -1

Install Firefox .deb package for Debian-based distributions

To install the .deb package through the APT repository, do the following: Create a directory to store APT repository keys if it doesn't exist:

sudo install -d -m 0755 /etc/apt/keyrings

Import the Mozilla APT repository signing key:

curl -fsSL https://packages.mozilla.org/apt/repo-signing-key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/packages.mozilla.org.gpg

If you do not have curl installed, you can install it with: sudo apt-get install curl

Next, add the Mozilla APT repository to your sources list:

echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.gpg] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null

Configure APT to prioritize packages from the Mozilla repository:

echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000
' | sudo tee /etc/apt/preferences.d/mozilla

Update your package list and install the Firefox .deb package:

sudo apt update && sudo apt install firefox

Taken from https://support.mozilla.org/en-US/kb/install-firefox-linux#w_install-firefox-deb-package-for-debian-based-distributions On this page there are also instructions for installing Firefox from Mozilla builds.

Migrate profile

If you have been using Firefox snap version and would like to keep data in your user profile you can follow these steps. If you have never used snap Firefox on your install then you can skip this. You will need to have used the snap Firefox at least once for a Firefox user profile to have been created.

mkdir -p ~/.mozilla/firefox/ && cp -a ~/snap/firefox/common/.mozilla/firefox/* ~/.mozilla/firefox/

Optional. Disable unattended upgrades.

You may want to perform this step because this service might bring back the snap version of Firefox. Thanks Ubuntu.

sudo systemctl status unattended-upgrades
sudo systemctl disable --now unattended-upgrades
sudo systemctl status unattended-upgrades

In file /etc/apt/apt.conf.d/20auto-upgrades

Change from enabled APT fucntions to disabled:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

after it shoud look like this:

APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "0";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment