How to install firefox on Ubuntu 20.04 and Ubuntu 22.04

Endrit Qerreti

Endrit Qerreti

In this tutorial, you will learn how to install firefox on Ubuntu 20.04 and Ubuntu 22.04.

There are many ways to install firefox on Ubuntu.

One way of installing firefox on Ubuntu 20.04 and Ubuntu 22.04 by downloading the official package of firefox that can be found on Ubuntu 20.04 and Ubuntu 22.04 repositories.

Another way of installing firefox is by using snap or flatpak, both these packaging formats can be used to install firefox.

Firefox can also be installed from the source without using flatpak, snap or the official package from the Ubuntu repositories.

In this tutorial, we'll be installing firefox using the official firefox package from the repositories of Ubuntu, and by the source.

Install Firefox via terminal

The fastest and easiest way to install Firefox on any Ubuntu version is by using the terminal, and installing the official package of firefox firefox.

To install firefox by downloading the official package of firefox that is found on the main Ubuntu repositories, simply run the command below.

sudo apt install firefox -y

Install Firefox from the source

Mozilla offers the source project that you can download and use it to install firefox manually on your machine.

The difference between installing firefox from the source and via official firefox package from the main repositories, is that when installing from source you need to copy files manually and symlink firefox in order to be able to launch, while when you install the official package you don't have to do anything but installing firefox via apt.

To install firefox from the source, first you need to download the source.

1) Download firefox tarball project

wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/120.0.1/linux-x86_64/en-US/firefox-120.0.1.tar.bz2

2) Extract tarball project

tar xvf firefox-120.0.1.tar.bz2

3) Copy firefox files to your /opt directory. This is the directory that is reserved for adding optional softwares. To do this, you can use the mv command.

sudo mv firefox /opt/firefox-browser

4) Symlink firefox so that you can use the version that you downloaded.

sudo ln -s /opt/firefox-browser/firefox /usr/bin/firefox 

5) Firefox is now installed on your system, and you can proceed to launch it.

firefox

Uninstall Firefox

You can uninstall Firefox easily from your system depending the method you used to install it.

If you installed firefox via apt by downloading the official package, then you can uninstall firefox by using apt.

sudo apt remove firefox

If you installed firefox from the source, then to uninstall firefox, you can do so by removing the files manually. To do so, run the commands below one by one.

sudo rm -rf /opt/firefox-browser /usr/bin/firefox

Conclusion

In this tutorial, you learned how to install Firefox on Ubuntu 20.04 and Ubuntu 22.04 via two different methods.

In the first method we showed you how to install firefox by using the official package of firefox, that is found on the official Ubuntu repositories, for Ubuntu 20.04 and Ubuntu 22.04.

In the second method, we showed you how to install firefox from the source, by downloading the copying files manually from the tarball project downloaded from the official website of firefox.

By now you should be able to use firefox, whether you installed it from the source or via apt.