For Ubuntu Linux users, keeping Mozilla Firefox up to date is crucial for security and performance enhancements. While Firefox offers automatic updates, there are situations where you might prefer or need to manually update it using the terminal. This guide provides step-by-step instructions on how to update Firefox from the terminal using different methods.

Method 1: Download and install Firefox directly from Mozilla using 'wget'

If you want the latest version of Firefox without waiting for the official Ubuntu repositories to update, you can download it directly from Mozilla's servers. This method works across all Linux distributions and avoids potential package conflicts caused by multiple PPAs.

Step 1: Download the latest Firefox archive from Mozilla using the wget command:

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

Step 2: Extract the contents of the downloaded archive:

tar -xvjf firefox-latest.tar.bz2

Step 3: Move the extracted Firefox directory to /opt/, which is commonly used for optional or third-party software installations:

sudo mv firefox /opt/

Step 4: Create a symbolic link to make the new Firefox executable accessible system-wide:

sudo ln -sf /opt/firefox/firefox /usr/bin/firefox

Explanation:

  • The wget command downloads the latest Firefox package directly from Mozilla.
  • The tar command extracts the files from the compressed archive.
  • The mv command moves the Firefox folder to the /opt/ directory.
  • The ln command creates a symbolic link to the Firefox executable, replacing the existing version.

After completing these steps, you can launch the updated version of Firefox by typing firefox in the terminal or selecting it from your applications menu.

Method 2: Update Firefox using Ubuntu's standard repository

You can update Firefox using Ubuntu's built-in package manager. This method ensures that Firefox integrates well with your system but may not provide the absolute latest version released by Mozilla.

Step 1: Update your package list to get the latest information on available packages:

sudo apt update

Step 2: Install or upgrade Firefox using the following command:

sudo apt install firefox

Note: For Ubuntu versions released before 2014, use apt-get instead of apt:

sudo apt-get update
sudo apt-get install firefox

This method installs the version of Firefox available in the Ubuntu repositories, which might lag behind the latest release from Mozilla due to different update cycles.

Alternative: To get the latest stable version through the package manager, you can add the Mozilla security PPA to your system.

Step 1: Add the Mozilla PPA repository:

sudo add-apt-repository ppa:ubuntu-mozilla-security/ppa

Step 2: Update your package list:

sudo apt-get update

Step 3: Install or upgrade Firefox:

sudo apt-get install firefox

Be cautious when adding PPAs, as having multiple repositories for the same package can lead to conflicts. If you experience issues, consider using the direct download method described in Method 1.


We hope this guide has helped you update Firefox on your Ubuntu system. If you have any questions or encounter any issues, please let us know in the comments below.