Way to avoid Snap version of Firefox and continue to use deb-package on freshly installed Ubuntu MATE 21.10

I have already prepared a draft titled "Ways to avoid Snap version of Firefox web browser". I'll put it below. Currently it is not needed, but let's save it for the near future.

There are signs that modern Ubuntu versions will ship Firefox as a Snap.
Some users will not accept this transition.

So below are three possible alternatives - two deb-packaged and one for local user installation.

At first we need to remove Snap'ed Firefox by command like:

snap remove firefox --purge

then at first try to install Firefox from official repository for Ubuntu 21.10 as simple as sudo apt-get install firefox or alternatival deb-packages (1a and 1b below) or extract local version (2).

1. Firefox or Firefox ESR installed from deb-package using 3rd-party repository

a. deb-packaged Firefox from UbuntuZilla - regular or ESR
Add UbuntuZilla repository with its signing key by

echo "deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main" | sudo tee -a /etc/apt/sources.list.d/ubuntuzilla.list > /dev/null
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2667CA5C
sudo apt-get update
sudo apt-get install firefox-mozilla-build

Note: if one needs ESR version - then replace last command with sudo apt-get install firefox-esr-mozilla-build.

Removal is possible by the following commands:

sudo rm /etc/apt/sources.list.d/ubuntuzilla.list
sudo apt-get autoremove --purge '*firefox*'
sudo apt-get update

b. deb packaged Firefox ESR version from Mozilla Team PPA

To get Firefox ESR version installed from Mozilla Team PPA use commands below:

sudo add-apt-repository ppa:mozillateam/ppa
sudo apt-get update
sudo apt-get install firefox-esr

Additional locales may be installed by using packages like firefox-esr-locale-it (example for Italian).

To remove deb-packaged Firefox one can use commands like:

sudo apt-get install ppa-purge
sudo ppa-purge ppa:mozillateam/ppa
sudo apt-get autoremove --purge

2. Locally extracted Firefox archive

If one needs to download and install Firefox to the home folder, then it is possible in the following way:

mkdir ~/Software ~/bin
cd ~/Software
wget -c http://ftp.mozilla.org/pub/firefox/releases/91.6.0esr/linux-x86_64/en-US/firefox-91.6.0esr.tar.bz2
tar -xf firefox-91.6.0esr.tar.bz2
ln -sf /home/$USER/Software/firefox/firefox ~/bin/firefox

# create desktop-file with long command below
mkdir -p ~/.local/share/applications/
cat <<EOF >  ~/.local/share/applications/firefox-user.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Name=Firefox ESR (local)
GenericName=Browser
Comment=Web Browser
Exec=firefox %u
Icon=/home/$USER/Software/firefox/browser/chrome/icons/default/default48.png
Terminal=false
X-MultipleArgs=false
StartupWMClass=Firefox
Type=Application
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
EOF

sudo apt-get install menu
update-menus

then logout and login back.

To remove such local installation use commands below:

rm -rf ~/Software/firefox
rm -v ~/.local/share/applications/firefox-user.desktop
rm -v ~/bin/firefox
update-menus

Discussion and notes:

My personal choice will be one of deb-based.
I would prefer ESR (1b) to get my Firefox behavior stable as it is needed for enterprise level application.

6 Likes