shiben.tech

Install Firefox on Lubuntu without Snap

Saturday, 05 April 2025, 10:58 AM
# tech linux

Snap comes packaged in, in most Ubuntu based distros. And if it doesn't (Lubuntu), it will come packaged in when you are installing something important e.g. Firefox. While it may be a good package manager, it consumes a lot of disk space due to sandboxing and duplication of data, which works detrimentally if you are trying to maintain a small/minimal Linux installation.

Let me show you how to accomplish installation of Firefox without Snap, on Lubuntu (or any other Ubuntu flavored distro). Go to the section "Firefox without Snap" directly, if don't have snap installed. Goes without saying to keep backups to not lose any of your important data or settings.

Install Snap by Mistake

It is very easy to overlook if snap is getting installed during an apt installation (e.g. Firefox). Let's do the mistake first intentionally, so that I can also show you how to remove it as well. Do sudo apt install firefox, and you will notice snapd package in the list of things getting installed. Great! You have immediately lost 1GB of space, which should have been a ~300MB installation.

Removing Snap

Snap is a package manager itself (installed additionally to apt). List what all is installed using:

sudo snap list

Remove the packages listed by above, one by one using the following command ...

sudo snap remove package-name

... in the following order (replace the package-name above with each of the following one by one): firefox gnome-version gtk-common-themes bare core22 snapd

Of course, you could have additional snap packages installed if you have a mature snap installation. Remove all of them, and the snap packages list must become empty.

Now that sudo snap list gives an empty result, we are ready to remove it:

sudo apt remove snapd

Following are some locations where snap likes to bloat itself. Check all these places for any leftovers that need to be removed.

$HOME/snap
/var/lib/snapd
/var/cache/snapd
/var/snap

Fantastic! You are officially snap free.

Discourage Future Snap

You still may get snap installed if you are not vigilant and this can be exhausting to keep track of. To make sure it is discouraged for apt, create a file /etc/apt/preferences.d/nosnap.pref and add the following text inside it.

Package snapd
Pin: release a=*
Pin-Priority: -10

Firefox without Snap

We are almost ready to install Firefox, but first, we have to do some preparations. First let's add official Mozilla repository entry for apt to pick up. Create a file /etc/apt/preferences.d/mozillateamppa and add the following text inside it.

Package: firefox*
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 501

Package: firefox
Pin: version 1:1snap*
Pin-Priority: -1

We would like our Firefox to auto update too. Create another file /etc/apt/apt.conf.d/51unattended-upgrades-firefox and add the following text inside it.

Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";

We are ready now!

Firefox Installation

Run the following three commands to finally get Firefox installed. The first command updates the repo-source for Firefox. The second updates the global source list for apt. The third, you guessed it, installs Firefox!

sudo add-apt-repository ppa:mozillateam/ppa
sudo apt update
sudo apt install firefox

And there you have it! You can check the list of packages for installation, snap should not show up in the list. Your Firefox installation size also will be much lower than when snap installs it.

Follow this video for a more detailed step by step instruction of accomplishing this properly.

You now have a Firefox installed natively on Lubuntu. If you found this useful, you may also find my other posts related to Linux interesting.