Most Linux distributions already ship with Firefox installed by their distribution package manager and configured as the default browser. It might be unavailable in the minimal version of the distribution.
In this article, you will learn how to install the latest Mozilla Firefox on major Linux distributions in different ways.
Install from your distribution package manager (Recommended)
Even though you were using the minimal version of the distribution, the popularity of Firefox will make it hard to neglect the distribution providers, including Firefox in their official repository.
Also Read: How to Strengthen Firefox Privacy and Security for Digital Surveillance
This way will make it easier for you to install Firefox on your Linux system and will also provide you with an easy way to update to the latest version automatically with system updates.
Without wasting any time, open your terminal app using the Ctrl+Alt+t or Ctrl+Shift+t keyboard shortcut and execute the following command depending upon your distribution type.
$ sudo apt install firefox #For Ubuntu and Debian-based distributions
$ sudo dnf install firefox #For Fedora and RHEL-based distributions
$ sudo pacman -Sy firefox #For Manjaro and Arch-based distributions
Once the application is successfully installed, execute the
firefox command or search for it in the menu of your distribution.
Also Read: How to Install LibreWolf Browser on Linux
If you do not want to have this application anymore in your system, feel free to remove it using the following command depending upon your distribution type.
$ sudo apt remove firefox #For Ubuntu and Debian-based distributions
$ sudo dnf remove firefox #For Fedora and RHEL-based distributions
$ sudo pacman -R firefox #For Manjaro and Arch-based distributions
Install from Flatpak
If you have installed and configured Flatpak on your Linux system, then you can easily install, run, and update it with the below command.
$ flatpak install flathub org.mozilla.firefox #To Install the Firefox Application
$ flatpak run org.mozilla.firefox #To Run the Firefox Application
$ flatpak update org.mozilla.firefox #To Update the Firefox Application
However, if you decide to go with the official repository and want to remove Firefox installed from Flatpak, then execute the below command.
$ flatpak uninstall org.mozilla.firefox
Install from Snap
Snap is the most debatable topic in the Linux community, although it’s already being shipped in the Ubuntu distribution. If you have snap installed and configured on your system, then follow the below command to install Firefox.
$ sudo snap install firefox #Will Install the Latest Stable Release
$ sudo snap refresh firefox #To Update the Firefox Application
After the application is installed, execute the
firefox command or search for it in the distribution menu.
However, if you decide to go with the official repository and want to remove Firefox installed from Snap, then execute the below command.
$ sudo snap remove firefox
Install Firefox from Mozilla Build (For advanced users)
If you have a geek worm in you telling you to install Firefox from the Mozilla Build, then I can’t do anything. Just follow the below method to fulfil your desire.
Step 1: Download the Mozilla Firefox Compressed File
Download the firefox compressed file from the official website.
Step 2: Extract the Compressed File
Open your terminal and go to the directory where you have downloaded the file and extract the content of the file using the below command.
$ cd ~/Downloads
$ tar xjf firefox-*.tar.bz2
Step 3: Move the Uncompressed Content to /opt
It’s time to copy the content inside the /opt directory, but before that, execute the below command to remove the firefox directory if it exists in the /opt directory.
$ sudo rm -r /opt/firefox
Now move the uncompressed Firefox directory to
$ sudo mv ~/Downloads/firefox /opt/firefox
Step 4: Creating a Symbolic Link
Finally, create a symbolic soft link for Firefox in /usr/bin to make it able to run from the command line.
$ sudo ln -s /opt/firefox/firefox /usr/local/bin/firefox
Step 5: Creating a Desktop shortcut
Until now, Firefox has only been accessible from the command line. To make it accessible from the menu, download the desktop file using the wget command and move it into the /share/application using the below command.
$ sudo wget https://raw.githubusercontent.com/mozilla/sumo-kb/main/install-firefox-linux/firefox.desktop -P /usr/local/share/applications
In future, if you want to completely remove Firefox from your system, execute the below commands in series.
$ sudo rm -r /opt/firefox
$ sudo rm /usr/local/share/applications/firefox.desktop
That’s all for now. Let us know in the comment section if you have any recommendations or queries regarding this topic.
Also Read: How to enhance Firefox security with about:config tweaks
Innovative tech mind with 12 years of experience working as a computer programmer, web developer, and security researcher. Capable of working with a variety of technology and software solutions, and managing databases.