How to Remove Firefox Snap from Ubuntu Linux

Navigating the software landscape of Ubuntu Linux often requires a keen understanding of its packaging systems. One such system, Snapcraft, developed by Canonical, offers a universal packaging solution. Among the applications available as Snap packages, Firefox, known as Firefox Snap, is prominent. While it provides benefits like easy updates and compatibility across Linux distributions, some users might find the need to remove Firefox Snap from Ubuntu for various reasons.

Reasons to Consider Removal:

  • Resource Intensity: Despite their user-centric design, Snap packages can be more resource-intensive. This might lead to noticeable performance drops, especially on older hardware setups.
  • Integration Hurdles: Firefox Snap, and Snap packages in general, might face challenges in seamless system integration. This can result in potential software limitations and a less-than-ideal user experience.

The beauty of Ubuntu’s open-source framework is its adaptability. If Firefox Snap doesn’t resonate with your needs, Ubuntu’s Mozilla PPA provides an alternative with the latest stable release of Firefox.

This guide will elucidate the steps to transition from the Snap version of Firefox to its latest stable release. We’ll delve into how to remove Firefox Snap from Ubuntu and subsequently install the browser through the Ubuntu Mozilla PPA.

Remove Firefox Snap From Ubuntu

Step 1: Disabling Firefox Snap on Ubuntu

The first step in this process is to disable the Firefox snap package. Disabling a snap package essentially puts it into a state where it can no longer run or consume system resources, but its data remains intact on your system. This is particularly useful if you intend to re-enable it later. However, in our case, this is a preparatory step for complete removal.

Here’s the command to disable the Firefox snap:

sudo snap disable firefox

After running this command, the Firefox snap will be deactivated, meaning it won’t be able to launch or consume system resources anymore.

Step 2: Remove Firefox Snap from Ubuntu

Once the Firefox snap is disabled, we can proceed with its removal. The command to remove a snap package uninstalls the package and removes all associated data. In this step, we will use the --purge option to ensure that all the data related to Firefox Snap is thoroughly cleaned up from the system.

Run the following command to remove Firefox snap:

sudo snap remove --purge firefox

This command will uninstall the Firefox snap and purge all associated data, leaving no residual files on your system.

Install Firefox on Ubuntu via Ubuntu Mozilla Team PPA

Step 1: Checking and Installing Required Packages on Ubuntu

In our journey to secure and up-to-date browsing with Firefox, the first crucial step involves ensuring that our system has all the necessary tools. This prerequisite check relies on installing two essential packages: software-properties-common and apt-transport-https. The former allows efficient repository management, while the latter equips the package manager to retrieve packages via HTTPS safely.

To affirm the presence of these packages or update them, execute the following command:

sudo apt install software-properties-common apt-transport-https -y

Step 2: Import Firefox Stable Repository on Ubuntu

Having equipped our system, we now steer towards adopting the stable version of Firefox. This pursuit requires integrating the Firefox Stable Repository into our system. In simpler terms, we add the Personal Package Archive (PPA) maintained by the Mozilla Team to our system’s list of repositories. This PPA is a goldmine for Ubuntu users, directly offering the most recent software versions from the developers.

The command for this PPA integration is as follows:

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

With sudo, we inform the system that we intend to execute the upcoming command with the elevated privileges of a superuser. The add-apt-repository script does the heavy lifting, seamlessly adding the APT repository to our system. Here, ppa:mozillateam/ppa signifies the specific PPA we wish to incorporate. Lastly, the -y flag smoothens our process by auto-confirming any prompts encountered during the operation.

Step 3: Configure Firefox APT Pinning on Ubuntu

We employ APT pinning to achieve the perfect balance between Firefox’s stable version and the default priority Snapcraft. This technique enables us to assign custom priority levels to different package sources within Ubuntu. To ensure precision and convenience, we use the echo command to introduce the required configurations into the configuration file directly:

echo -e "Package: firefox*\nPin: release o=LP-PPA-mozillateam-ppa\nPin-Priority: 550\n\nPackage: firefox*\nPin: release o=Ubuntu\nPin-Priority: -1" | sudo tee /etc/apt/preferences.d/99-mozillateamppa

By defining priorities, we express our preferences:

  1. The Firefox Stable PPA (Pin-Priority: 550) is our top pick.
  2. The Firefox Ubuntu Snapcraft repository (Pin-Priority: -1) is deactivated, ensuring Firefox installations via the Mozilla Team PPA instead of Snapcraft.

Step 4: Refreshing the APT Package Index After Firefox PPA Import on Ubuntu

With a new repository on board, we now need to inform APT about the potential new packages it can fetch. This step, called updating the APT package index, is pivotal for successfully retrieving packages from the newly added repository.

To update the APT package index, use the following:

sudo apt update

This command nudges APT to refresh its list of known packages based on the repositories stipulated in /etc/apt/sources.list and /etc/apt/sources.list.d/. This list will now include the recently added PPA, ensuring your system’s awareness of the most recent Firefox version.

Step 5: Install Firefox on Ubuntu via APT Command

With the foundation laid and preparations done, we can now proceed to the final step: installing the stable version of Firefox.

Execute the following command to install Firefox:

sudo apt install firefox -y

The apt install command directs the APT utility to install the firefox package, and the -y flag automatically affirms any prompts that might emerge during the operation. Once the command has run its course, your system will be equipped with the most recent stable Firefox version, thereby replacing the Snapcraft version we aimed to avoid.

Step 5: Verifying the Installation of Firefox on Ubuntu via PPA Method

With the installation complete, we want to ensure everything went as planned. The most effective way to confirm that we are now utilizing the APT’s native version with the Ubuntu Mozilla Team’s PPA Firefox stable version is to execute the following command:

apt-cache policy firefox

This command reveals vital information about the installed version and the repository from which it was fetched. If the output corresponds to the PPA version, you can rest assured that the installation was successful.

Screenshot displaying the cache policy for Firefox sourced from Mozilla PPA on Ubuntu Linux.
An example of the cache policy settings for Firefox when installed from the Mozilla PPA on Ubuntu Linux.
Screenshot of the Mozilla Firefox browser installed on Ubuntu Linux.
A snapshot of the Mozilla Firefox browser post-installation on an Ubuntu Linux desktop.

Closing Thoughts on Removing Firefox Snap

In conclusion, we’ve explored a comprehensive guide on removing the Snapcraft version of Firefox from an Ubuntu Linux system and replacing it with the stable version from the Mozilla Team’s Personal Package Archive (PPA). This process involves disabling and purging the Snap package, updating the APT package index to recognize the new PPA, and installing the stable Firefox version. Following these steps will provide you with the most recent stable version of Firefox and potentially reduce system resource usage and software limitations associated with Snap packages.

Your Mastodon Instance
Share to...