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
or
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
or
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
cd ~
Download tar.bz2 file of the latest version from Mozilla’s website.
wget https://ftp.mozilla.org/pub/firefox/releases/59.0.2/linux-x86_64/en-US/firefox-59.0.2.tar.bz2
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:
~./firefox/firefox
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
Firefox is now available on snap store. Assuming your system already have snap installed, type:
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:
killall firefox
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.
thanks for helping
"sudo apt-get firefox
E: Invalid operation firefox"
Is this a dependency issue? Or is firefox no longer available via apt-get?
Linux O/S: Ubuntu 18.04
There is a typo in your command, it should be "sudo apt-get install firefox"
on the latest Debian / Raspberry Pi OS I type
sudo apt-get install firefox
and get Package firefox is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'firefox' has no installation candidate
Did you try running apt-get install firefox-esr ?