Ubuntu 22.04 – Migrating from Firefox snap to Firefox apt

Using snaps might have its advantages, but the amount of RAM and CPU cycles that Firefox seems to take made me want to switch. The browser certainly feels more responsive.

Remove the Firefox snap.

# snap remove firefox

If you don't have an APT keyring create one, import the Mozilla APT repository signing key and add it to your sources.
# install -d -m 0755 /etc/apt/keyrings

$ wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null

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

You need to change the Firefox apt priority to avoid the snap version being re-installed.

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

And install the Firefox apt.

# apt update && sudo apt install firefox

[Install a localised version if you need it or want it]

# apt install firefox-l10n-gb

When you launch Firefox it will now be the apt version. Remember to move/copy your profiles from the snap to the new version.

$ cp -a ~/snap/firefox/common/.mozilla/firefox/* ~/.mozilla/firefox/

Finally, launch Firefox and point to the right profile (and delete any you don’t want to keep).

This is best done using the Profile Manager (about:profiles):