In Ubuntu, the Mozilla Firefox (default) web browser is an open-source tool that comes with the installation of the operating system. Sometimes, the users may wish to remove it, or some issues can cause it to malfunction, which requires the user to uninstall and reinstall Firefox from scratch. Mozilla Firefox comes with two packages, apt and snap. Default Mozilla Firefox installation comes with the snap package.
This article will demonstrate the methods to clean, uninstall and reinstall Firefox in Ubuntu. The content for the post is:
- Uninstalling the apt Package of Firefox
- Re-installing the apt Package of Firefox
- Uninstalling the snap Package of Firefox
- Re-installing the snap Package of Firefox
Uninstalling the apt Package of Firefox
To completely uninstall the apt package of the Firefox, users can use the “purge” option which will remove the package and configuration files as well. Run the given command in the terminal:
$ sudo apt purge firefox
The Firefox browser has been removed.
After that, Remove the Firefox files located in the “/etc/Firefox” directory that contains the user profile is obtained as follows:
$ sudo rm -Rf /etc/firefox/
The Firefox directory will be removed.
Remove the downloaded extension (Add-ons) files of Firefox located in the “/usr/lib/Firefox” directory:
$ sudo rm -Rf /usr/lib/firefox*
The directory containing the “Add-ons” file will be removed.
Re-installing the apt Package of Firefox
To re-install the apt package of Firefox is obtained as follows:
$ sudo apt install firefox
After executing the above command, Firefox will be installed.
To check the installation of Firefox, you can run the given command to display the version of the Firefox browser.
$ firefox --version
The Firefox version 108.0.2 has been installed
Note: You can also use the re-install command for reinstalling Firefox:
$ sudo apt install --reinstall firefox
The Firefox will be re-installed.
Uninstalling the snap Package of Firefox
If you have the snap package of Mozilla Firefox and want to remove it, you can use the given command for removing the snap package:
$ sudo snap remove firefox
The snap package of Firefox has been removed successfully.
Re-installing the snap Package of Firefox
To install the snap package of Mozilla Firefox, excuse the following command:
$ sudo snap install firefox
After some time, the package will be installed, and it can be seen in the above image.
Conclusion
To uninstall Firefox, use the “sudo apt purge Firefox” command for the apt package or the “sudo snap remove Firefox” command for the snap package. Run the “sudo apt install Firefox” command for the apt package or “sudo snap install Firefox” for the snap package. Mozilla Firefox can also be reinstalled using the “sudo apt install –reinstall Firefox” command. This write-up has illustrated methods for uninstalling and reinstalling Firefox in Ubuntu.