Mozilla Firefox is the official Internet browser for Ubuntu, therefore, most Ubuntu distros have it installed by default. If your system lacks this browser due to any reason or if you have accidentally deleted it, we will tell you how to install it on your Ubuntu. In this article, we will describe the following ways to install Mozilla Firefox on your system. You can then make a choice based on the source you want to install Firefox from and also if you want to use the UI or the command line.
- From the Snap Store-through the Ubuntu Software Manager
- From the Official Ubuntu Repository-through the command line
- From the Mozilla PPA repository-through the command line
- From Mozilla.org website-through the command line
We have run the commands and procedures mentioned in this article on a Ubuntu 18.04 LTS system.
Method 1: From the Snap Store-through the Ubuntu Software Manager
For a person who does not want to open the Command Line much, installing a software present in the Ubuntu repository through the UI is very simple. On your Ubuntu desktop Activities toolbar, click the Ubuntu Software icon.
Click the search icon and enter FireFox in the search bar. The search results will list the Firefox entry as follows:
This is the package maintained by the snap store. Click on the Firefox search entry to open the following view:
Click the Install button to begin the installation process. The following authentication dialog will display for you to provide your authentication details as only an authorized user can install software on Ubuntu.
Enter your password and click the Authenticate button. After that, the installation process will begin, displaying a progress bar as follows:
Mozilla Firefox will then be installed to your system and you will get the following message after a successful installation:
Through the above dialog, you can choose to directly launch Firefox and even Remove it immediately for whatever reason.
Launch Firefox
Ideally, Firefox should now be available in your system Dock/Activities panel. You can also access it from the Ubuntu application launcher bar as follows, or directly access it from the applications listing:
Remove
If you want to remove Firefox that was installed using the above method, you can remove it from your system as follows:
Open the Ubuntu Software Manager and search for Firefox as follows:
You will see the Installed status in the search entry as shown above. Click this entry and then click Remove from the following view:
The system will prompt you with an Authentication dialog. The software will be removed when you provide the password for sudo user and click Authenticate on the dialog.
Method 2: From the Official Ubuntu Repository-through the Command Line
Firefox being the official Ubuntu browser is also available on the Official Ubuntu repository. It can be easily installed through the command line as follows:
Open the Terminal either through the Ctrl+Alt+T shortcut or the Ubuntu Application Launcher search.
Enter the following command to update your system’s repository index with that of the internet repositories:
$ sudo apt-get update
This way you can install the latest available version of software on your system.
Then enter the following command in order to install Mozilla Firefox from the official Ubuntu repository:
$ sudo apt install firefox
Please note that only an authorized user( sudo) can add, remove and configure software on Ubuntu. Enter the password for sudo after which the installation procedure will begin.
This might take some time, depending on your Internet speed, after which Firefox will be installed on your system.
Launch Firefox
Run the following command in your Terminal in order to launch Firefox:
$ firefox
Remove
You can remove Firefox completely, along with any configurations you might have made, through the following command:
$ sudo apt-get purge firefox
Otherwise, you can use the following command in order to simply uninstall Firefox:
$ sudo apt-get remove firefox
Method 3: From the Mozilla PPA repository-through the command line
The Mozilla PPA repository includes the latest version of Firefox. Follow these steps in order to install Firefox through this PPA repository:
First, please open the Terminal either through the system Dash or the Ctrl+Alt +T shortcut
Then, enter the following command in order to add the signing key for Mozilla PPA:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6DCF7707EBC211F
Now, enter the following command to add the Mozilla PPA repository to your Ubuntu:
$ sudo apt-add-repository "deb http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu bionic main"
Please note that only an authorized user can add, remove and configure software on Ubuntu. Enter the password for sudo, after which the PPA repository will be added to your system.
Tip: Instead of typing the command, you can copy it from here and paste in the Terminal by using the Ctrl+Shift+V, or by using the Paste option from the right-click menu.
The next step is to update your system’s repository index through the following command:
$ sudo apt-get update
This helps you in installing the latest available version of software from the Internet.
Now that you are done with all the prerequisites required to install Firefox, use the following command as sudo in order to install Mozilla Firefox on your system:
$ sudo apt-get install firefox
Launch Firefox
Run the following command in your Terminal in order to launch Firefox:
$ firefox
Remove
You can remove Firefox completely, along with any configurations you might have made, through the following command:
$ sudo apt-get purge firefox
Otherwise, you can use the following command in order to simply uninstall Firefox:
$ sudo apt-get remove firefox
Method 4: From the official website through the command line
If you do not have, or do not want to use any other existing browser on your system, here is how to install Firefox from the official Mozilla.org website using the command line.
Open the Terminal either through the system Dash or the Ctrl+Alt+T shortcut. Enter the following command in order to download the Firefox Setup tar.bz2 file from Mozilla.org:
$ wget -O ~/FirefoxSetup.tar.bz2 "https://download.mozilla.org/?product=firefox-latest&os=linux64"
The file is by default saved in the current user’s home folder.
Extract the file to the /opt folder of your Ubuntu by using the following command as sudo:
$ sudo tar xjf ~/FirefoxSetup.tar.bz2 -C /opt/
Now, create a Firefox executable in /usr/lib/ that points to the location where you extracted the .tar.bz2 file (the /opt folder). Use the following command to do so:
$ sudo ln -s /opt/firefox/firefox /usr/lib/firefox/firefox
Launch Firefox
Run the following command in your Terminal in order to launch Firefox:
$ firefox
Remove
In order to remove Firefox installed through this method, run the following command as sudo in your Terminal:
$ sudo rm -fr /opt/firefox
You can also delete the .tar.bz2 file that you initially downloaded from the Mozilla website.
So, this was not one but four ways to install Mozilla Firefox on your Ubuntu. Enjoy browsing!