Linux Tutorials

How to Uninstall and Install Firefox on Ubuntu

Uninstall and Install Firefox on Ubuntu
Written by Vivek

Mozilla Firefox, very much like Linux, is a free and open-source software. Mozilla claims to be a non-profit company as well. If you’re wondering where I’m leading with this, it is the fact that Mozilla Firefox is the default browser for Ubuntu and some other Linux distributions. And now you know why Firefox fits so nicely into the philosophy of Linux. Philosophy aside, Firefox is but a piece of software. This means it can bug out sometimes. This may make you want to uninstall Firefox. In the hope that when you install Firefox again, the problem would be gone. Or maybe you’ve found a browser that you like better and just want to get rid of Firefox now.

Whatever your reasons, uninstalling Firefox is not something very difficult compared to other app uninstallations on Ubuntu. Compared to uninstalling firefox from a Mac or Windows though it is a bit more complicated. If you simply uninstall Firefox, with the intention to install it again, you will find the new installation still has the same settings and preferences that made things worse in the first place. This is because uninstalling firefox the traditional way does not remove the settings and preferences which are saved elsewhere in other folders. Before we take a look at how you can get rid of Firefox completely along with all its stored data, you’ll need something.

How to Uninstall and Install Firefox on Ubuntu

Install GKSu

GKSu is a library that provides a Gtk+ frontend to su and sudo.

Removing the data stored by firefox involves deleting files created by Firefox in the root directories. You can do this via the terminal without any need for GKSu. However, if you prefer to do things with a graphical interface you will need to install GKSu in case you don’t already have it. To install it simply enter the following in a terminal:

sudo apt install gksu

How to uninstall Firefox

  1. In a terminal window, run the following command:
    sudo apt-get purge firefox
  2. Once that is done, launch your file browser and head to the home directory. It’d be preferable to launch it with root permissions since some of the folders that need to be removed can’t be removed without root access. This is where GKSu comes in handy. Simply execute the following command to launch Nautilus, the default file manager in Ubuntu, as a root app.
    gksu nautilus
  3. Delete the folder named .mozilla if it is still there. This is a hidden folder so you will have to make sure hidden files and folders are visible in order to see it. If you were having troubles with adobe flash player on Firefox, you may also want to delete the folders named .macromedia and .adobe, if present. These folders generally contain the flash cookies stored by the browser.
  4. Now let’s remove folders in the root directories. First, delete the folder named firefox inside etc (/etc/firefox/). This is where your preferences and user profiles are stored.
  5. Similarly, go to the /usr/lib/ folder and delete the folders named firefox and firefox-addons there. It’s possible that you may not find these folders there anymore. How To Uninstall And Install Firefox In Ubuntu
  6. Reboot your computer to get rid of any temporary files.

How to install Firefox again

You can now install the same Firefox again, or you can install a different version of Firefox such as one of the daily builds or betas. The daily builds are not really very stable and you might be frustrated even if you just use Firefox as a secondary browser. So we’d rather not recommend it. Beta builds are relatively more stable, and usable as well.

Install Firefox stable

How To Uninstall And Install Firefox In Ubuntu

Run this command in a terminal:

sudo apt-get install firefox

Install Firefox official beta

If you would like to test out beta versions, you can just install Firefox with the command mentioned above and then upgrade to a beta. This requires adding the official Firefox beta ppa.

sudo apt-add-repository ppa:mozillateam/firefox-next
sudo apt-get update && sudo apt-get upgrade