In most modern Linux distributions, the latest version of Firefox has been already installed from the default distribution package manager and configured as the default browser.
In this article, we will explain other ways of installing the latest version of Firefox on RHEL-based distributions such as CentOS Stream, Fedora, Rocky, and AlmaLinux and Debian-based distributions such as Ubuntu and Linux Mint.
Table of Contents
1. Install Firefox Using Package Manager
To install Firefox on your Linux distribution using the default package manager, run:
$ sudo apt install firefox [On Debian, Ubuntu and Mint] $ sudo yum install firefox [On RHEL/CentOS/Fedora and Rocky/AlmaLinux] $ sudo emerge -a www-client/firefox [On Gentoo Linux] $ sudo apk add firefox [On Alpine Linux] $ sudo pacman -S firefox [On Arch Linux] $ sudo zypper install firefox [On OpenSUSE]
The above installation method is recommended because it assures that Firefox and along with the needed libraries are installed and configured on your distributions.
However, there might be a little delay between the release of the latest Firefox version and the moment when your distribution updates the new version of Firefox is available to install from the default repositories.
2. Install Firefox Using Flatpak
To install the new Firefox version, you need to first install and configure Flatpak on your Linux distribution. Once Flatpak is installed, navigate to Firefox Flathub’s page and hit the Install button to install it.
Alternatively, you can type the following command to install Firefox in a terminal:
# flatpak install flathub org.mozilla.firefox
3. Install Firefox Using Snap
To install Firefox from Snap, first, you need to install Snap on your distribution. Once Snap is installed, navigate to the Firefox Snapcraft’s Store page, and hit the Install button to follow the instructions.
Alternatively, you can run the following command to install Firefox in a terminal:
# sudo snap install firefox
4. Install Firefox from Source in Linux
To install Firefox from the source tarball, you must log in as a root user or have sudo privileges to execute sudo commands on the system.
Open any web browser and visit the official Firefox download page and click on the Download Now button.
Next, open a terminal and go to the Downloads directory, where you have downloaded Firefox, and install it as shown.
# cd ~/Downloads # tar xjf firefox-*.tar.bz2 # mv firefox /opt # ln -s /opt/firefox/firefox /usr/local/bin/firefox # wget https://raw.githubusercontent.com/mozilla/sumo-kb/main/install-firefox-linux/firefox.desktop -P /usr/local/share/applications
To verify that Firefox has been successfully installed, open the Troubleshooting Information page. In the Application Basics window, the value of Application Binary should be /opt/firefox/firefox-bin.
Uninstall Firefox from Linux System
If you have installed Firefox from the default distro-based package manager, you should run:
$ sudo apt purge firefox [On Debian, Ubuntu and Mint] $ sudo yum remove firefox [On RHEL/CentOS/Fedora and Rocky/AlmaLinux] $ sudo emerge --deselect firefox [On Gentoo Linux] $ sudo apk del firefox [On Alpine Linux] $ sudo pacman -R firefox [On Arch Linux] $ sudo zypper remove firefox [On OpenSUSE]
If you have installed Firefox using Flatpack or Snap, run:
# flatpak uninstall flathub org.mozilla.firefox OR # snap remove firefox
If you have installed Firefox from the source binary package, simply remove the folder firefox in your home directory to uninstall Firefox.
# rm -rf /opt/firefox/firefox # rm -rf /usr/local/share/applications/firefox.desktop # rm -rf /home/user/.mozilla/
The above commands will remove Firefox along with the user data such as bookmarks, passwords, and cookies.