Firefox is the most popular web browser among Linux users. In this article, we are going to cover topics like Firefox installation, uninstall, and update. We will also discuss what kind of problems we can get during the mentioned processes.
Depending on type of Linux distribution we use the process of installation Firefox in Linux is different:
Install Firefox using apt-get
If you are using a Debian based system such as Ubuntu 16.04/18.04/20.04, you need to use apt to install packages.
To install the latest version using apt-get, type:
sudo apt-get install firefox
On Debian 10, type:
sudo apt-get install firefox-esr
If you want to install a specific version of Firefox, you need to download it from Mozilla website (open this link, choose version, OS and language). Downloaded file will have tar.bz2 extension. Once file is downloaded, extract it using the following command:
tar xjf firefox-*.tar.bz2
where instead of * you must type the version you’ve downloaded
Now you can open Firefox by running ./firefox/firefox from the download path. You can create icon on your Desktop which will open this file for more convenience. Also don’t forget to turn off automatic updates for this version of Firefox, otherwise it will be updated to the latest one.
Manually installed Firefox will work as well as the default one (if you have one). Thus, you can have as many versions as you wish.
To update Firefox on your Debian based system, type the following commands in the terminal:
sudo apt-get update
which will update all packages or
sudo apt-get install firefox
This one will try to install firefox and will do nothing if you are already using the latest version.
To uninstall Firefox which was installed using apt, make sure Firefox is closed and then type the following command in the terminal:
sudo apt remove firefox
To remove firefox-esr, type:
sudo apt-get remove firefox-esr
To remove the firefox package and all its dependant packages,
sudo apt-get purge firefox
sudo apt-get purge firefox-esr
In order to remove the specific version of Firefox which was installed manually, you can simply delete the folder in which Firefox files have been extracted.
Install Firefox using yum
If the Linux distribution you are using is RedHat based (Fedora 21 and below, or CentOS) then your default dependency resolver for the underlying package manager is YUM. Yum syntax is very simple and apt users shouldn’t face any problem using it.
To install Firefox using yum, you can type the following command in the terminal:
yum install firefox
This command will install Firefox 52.7.2. If you want to install latest version of Firefox, you need to do it manually as described in apt section above. At the time of writing this article latest stable release of Firefox was 59.0.2.
Change your directory to home
Download tar.bz2 file of the latest version from Mozilla’s website.
Modify 59.0.2 if you want to download another version.
Extract the downloaded archive
tar xjf firefox-59.0.2.tar.bz2
Now you can open Firefox by typing in the terminal:
To be able to open Firefox from anywhere just by typing “firefox”, you need to create symlink:
sudo ln -s /home/linoxide/firefox/firefox /usr/bin/firefox
Updating firefox can be done either from browser itself or by reinstalling manually a newer version. To do this just remove the folder where firefox has been extracted and install newer version in the same directory. In this case there is no need to create symlink again.
To remove Firefox which was installed via yum type:
yum remove firefox
Install Firefox using snap
snap install firefox
Install Firefox using pacman
Pacman is the default package management system for Arch Linux. To install Firefox using pacman you must open terminal and run the following command:
sudo pacman –S firefox
This will install latest stable version of Firefox, which was 59.0.2 at the time of writing this article.
The process of installing specific version of Firefox is the same as in other distributions mentioned above.
To remove Firefox from Arch Linux type the following command in the terminal:
sudo pacman –Rs firefox
This will remove Firefox and its dependencies which are not required by any other installed package.
Possible problems while uninstalling/reinstalling or updating Firefox
While uninstalling Firefox, first make sure it’s not running. You can do that by typing the following command in the terminal:
ps ax | grep [f]irefox
If Firefox is running, just quit it. If it appears in the output of the command above, but actually it doesn’t running, type the following command to kill Firefox process:
After this command check again with
ps ax command and if output contains firefox, type
killall -KILL firefox
If this doesn’t help too, try to execute this command with sudo privileges:
sudo killall –KILL firefox
If this doesn’t help as well, reboot your machine and start from scratch.
While updating Firefox to a newer version you can get problems related to your profile. In that case you need to clear out your profile. You can do that with this command
mv ~/.mozilla ~/.mozilla.old
Installing Firefox via terminal isn't much harder than to install it from GUI package manager with several clicks. Vice versa, it is much faster.