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):

https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles




Ubuntu: Change default language/dictionary in Firefox

If you install Firefox via repositories it might not install with your preferred language/settings. If your distro is in English it will default to American English as the main language and other English variations as additional spelling dictionaries.

You can change this from the CLI. The below examples will leave British English as the default buy it can be easily be adapted to your needs.

Be warned that the spellchecker is shared with other applications like LibreOffice.

Check which spellchecker is installed on your system. Older versions used myspell and current ones use hunspell.

$ apt list --installed | grep myspell
$ apt list --installed | grep hunspell

Older versions

# apt remove myspell-en-au myspell-en-us myspell-en-za myspell-en-ca

# apt install myspell-en-gb

Current versions

# apt remove hunspel-en-au hunspell-en-us hunspell-en-za hunspell-en-ca

# apt install hunspell-en-gb