Install Mozilla Firefox on Ubuntu 22.04


Firefox is a renowned internet browser that comes by default in the complete installation of Ubuntu 22.04. The latest version of Firefox offers improved security, private browsing, and tracker blocking (trackers from social platforms or cookies). To meet the technological evolution, Firefox has an interactive design and a competitive browsing speed which ultimately enhances the user experience.

The uniqueness and fastness in providing quality browsing have enabled Firefox to be a default browser in Ubuntu 22.04. However, if you have obtained the minimal installation, Firefox may not be available. In such a case, Ubuntu 22.04 offers multiple sources to install Firefox.

This post will list the potential methods to install Firefox on Ubuntu 22.04 (if not available already), with the following outline:

How to Install Firefox on Ubuntu 22.04?

Firefox is available on the Snap store, the flatpak store, the PPA Repository, and the binaries from the official resources. Let’s get started with the Snap method:

1. How to Install Firefox Using the Snap?

Snap, if enabled on Ubuntu 22.04 has the CLI (through the terminal) and the GUI (through the Ubuntu Software Centre) access available. Let’s discuss the CLI method first:

  • CLI Support of Snap

Install the snap support (by installing snapd) and also get the low-level (by installing snap core) dependencies for the snaps to be installed on the system:

$ sudo apt install snapd && sudo snap install core

Now, install Firefox from the snap using the command:

$ sudo snap install firefox

Verify the installation by checking the installed version of Firefox, as follows:

$ firefox --version

The installation can also be verified by running the following command, which will launch Firefox:

$ firefox
  • Bonus Tip: How to Install Firefox Snap Using the apt?

Firefox default repository’s support is now merged with the apt and the Firefox package is available with the name “firefox”. Thus, by using the following command, you can install Firefox Snap via apt:

$ sudo apt install firefox
  • GUI Support of Snap

Search for the Firefox application in the Ubuntu software center. Click on the Firefox found in the search results:

Now, click the install button:

After that, provide the user password:

The Firefox will be installed upon successful authentication.

2. How to Install Firefox Using Flatpak?

Flatpak is a package manager like Snap or apt. Flatpak offers Linux-wide support of tens of applications without any dependencies conflict. Flatpak applications are more managed, stable, and recommended when compared with the Snaps. Let’s see how Firefox can be installed using flatpak:

First, install the flatpak utility support via the command:

$ sudo apt install flatpak

Flatpak packages are downloaded/installed by accessing the flathub repository. Therefore, add (if it does not exist already) the remote support of the falthub repository (before installing the applications):

$ sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Once done, use the below command to install Firefox:

$ flatpak install flathub org.mozilla.firefox

To run the Firefox installed using the flatpak, use the below command:

$ flatpak run org.mozilla.firefox

3. How to Install Firefox Using the PPA?

PPA (Personal Package Archive) is another source (a repository) for installing applications on Ubuntu. PPAs are managed by individuals or the community and PPAs usually contain the latest release of the package that is yet not made available on the default repository. Firefox is available through the PPA as well which can be installed via the following steps:

Step 1: Add the mozillateam PPA

First, add the mozillateam PPA to the apt list via the command:

$ sudo add-apt-repository ppa:mozillateam/ppa

Step 2: Set the Preference for the apt

Add the following content to the “preferences.d” file to allow apt to load the package added via the apt (without doing so, you will not be able to install Firefox from PPA):

$ echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox

Step 3: Install Firefox

Use the below command to update the packages list and install Firefox:

$ sudo apt update && sudo apt install firefox

Note: The output shows that the installed Firefox version is the latest than being installed via this PPA. The added PPA also contains another Firefox-esr. If you want to install that one, use the “firefox-esr” keyword instead of “firefox”.

Use the below command to launch it:

$ firefox

Or run/launch the Firefox from the applications menu of Ubuntu 22.04.

4. How to Install Firefox Using the Mozilla Builds (FirefoxTarball)?

Firefox has its tarball available on the official website of Mozilla. The tarball contains the Firefox executable which can be used to launch/run Firefox. Let’s do it:

Step 1: Download the TAR File

Navigate to the Firefox For Linux Page and click on the download button to start downloading:

Or, you can use the following command to download the file (it would download in the home directory with the name “firefox.tar.bz2”):

$ wget -O ~/firefox.tar.bz2 "https://download.mozilla.org/?product=firefox-latest&os=linux64"

Step 2: Extract the Downloaded File

When inside the directory, use the following “tar” command to extract the binaries (replace the exact name of the file in place of “firefox”):

$ sudo tar xjf ~/firefox.tar.bz2 -C /opt/

Step 3: Move the Current Firefox Executable/Create a Backup

To use the Firefox installed from binaries, you must move your Firefox’s executable from the directory “/usr/bin/” to any of the directories (or you can rename the same file and place it in the same directory). This process will ultimately create a backup of Firefox’s executable (which can be reused to use Firefox if any disruption occurs).

The command below renames the current Firefox executable to a file ending with “_bck”:

$ sudo mv /usr/bin/firefox /usr/bin/firefox_bck

Note: To get the path of the Firefox executable, you can use the following command:

$ which firefox

Step 4: Create a Symbolic Link

Create a symbolic link of the “executable placed in the extracted directory” in the directory “/usr/bin/” so that the system starts recognizing the newly installed Firefox:

$ sudo ln -s /opt/firefox/firefox /usr/bin/

And here you go with the Firefox:

$ firefox

 

How to Update Firefox on Ubuntu 22.04?

Firefox releases the updates/bug fixes continuously. These are updated in the core libraries of the package managers. Let’s check out these updating methods:

Using Snap (GUI)

Navigate to the “Update” tab of the Software Centre and check if any update is available. If so, click on the “Update” button in front of it to proceed with it:

Using Snap (CLI)

$ sudo snap refresh firefox

Using apt

$ sudo apt install firefox

Using the Binaries

If you want to update the Firefox installed with the binaries, you need to download the latest available version and then extract it in the same directory where your previous Firefox file is extracted.

In our case, the first command below will download the binaries whereas the second command will extract the downloaded binaries to the directory (where the binaries are extracted):

$ wget -O ~/firefox.tar.bz2 "https://download.mozilla.org/?product=firefox-latest&os=linux64"
$ sudo tar xjf <Path-of-the tar.bz2-File> -C /opt/

Note: Ensure that you are extracting the binaries where the binaries of older versions are placed. Doing so will automatically update the executable information in the symbolic link, and hence firefox will be updated.

 

How to Remove Firefox From Ubuntu 22.04?

As discussed, Firefox can be installed from multiple sources. Thus, the removal process depends on the method you used to install Firefox, which is as follows:

If Installed Using snap

$ sudo snap remove firefox

Note: The snap for Firefox is now merged with the apt. Thus, a Firefox installed from the snap store can also be removed using the following apt command:

 

$ sudo apt autoremove firefox

Note: To uninstall the Firefox using GUI, search for Firefox in the applications menu. Click on it and then on the Uninstall/Remove button to remove it.

If Installed Using PPA

Remove the Firefox via the command:

$ sudo apt autoremove firefox

Then, remove the mozillateam PPA from your system too:

$ sudo add-apt-repository --remove ppa:mozillateam/ppa

If Installed Using Flatpak

$ flatpak uninstall org.mozilla.firefox

If Installed Using Binaries

First, you have to remove the directory where you have extracted the “tar.bz2” file:

$ sudo rm -r /opt/firefox

Then move the backup file (by providing its location where you have placed it) to its original location:

$ sudo mv /usr/bin/firefox_bck /usr/bin/firefox

That’s how you can effectively manage the Firefox on Ubuntu 22.04.

 

Bottom Line

Firefox is a browser known for its browsing speed, stability, resource efficiency, tracking control/block, and more. That’s the reason it is the default browser in the complete installation of Ubuntu 22.04.

The potential installation methods of Firefox are demonstrated in this guide. Either you can use the snap, the flatpak, PPA, or Firefox’s binaries. Apart from installation, the relevant updating/removing methods are also illustrated here.

Print Friendly, PDF & Email
Categories
Tags