Snap handles the package installation, deployment, and removal of software on Linux distributions, just like ‘apt’. In fact, Snap is a proposed better alternative of apt. It’s been hailed by Canonical and Ubuntu as the best package management and installation repository on Linux. To be fair, it does have a few advantages. For instance,
- Snap packages are auto-updated
- Dependencies are bundled within the snap package. So, no additional installation
- Snap applications work within a sandbox environment
- Most popular applications from major publishers like KDE, Microsoft, Google are on the snap repository
Problems with snap
The Linux community has been discussing Canonical’s push for snap and the issues with it. This entire snap debate has again started after the Ubuntu 20.04 launch.
The latest Ubuntu variant ships with an empty Chromium package. The package is empty, and acts, without your consent, as a backdoor by connecting your computer to the Ubuntu Store. In simple words, if you do a simple “sudo apt install chromium-browser”, it executes the command and installs the snap package instead of the Debian one. More importantly, without your consent. Have a look at the screenshot below.
It clearly fetches the snap package when the command is for an apt package.
Moreover, there’s been a lot of underlying problems with Snap. Snap packages take a lot of time to install and even launch. In addition to that, snap packages take up a lot more space, don’t match your Ubuntu theme, and aren’t always official. In case you want to avoid this whole snap thingy, removing the snap repository from Ubuntu completely would be a good option, and here’s how you do it.
How to Remove Snap From Ubuntu
Step 1: Check for installed snap packages
Before we begin to remove snap, you need to check if you have snap packages installed in your system. To check for snap installed packages, run the following command.
Step 2: Remove snap packages
In case you get an output like above, we are good to proceed. If you find packages installed under snap list, you’d have to remove them by using the following command.
sudo snap remove --purge package-name
“package-name” needs to be removed with the actual installed package name. We also have a detailed guide on how to uninstall applications from Ubuntu.
First of all, we need to clear the snap cache.
sudo rm -rf /var/cache/snapd/
Step 3: Uninstall snap and snap GUI tool
Once done, we can remove the snap package as well as the snap GNOME plugin. To do that, run the following command.
sudo apt autoremove --purge snapd gnome-software-plugin-snap
Step 4: Clear snap preferences
Next, we can clear the snap settings and preferences from your home directory
rm -fr ~/snap
Now, these commands will remove the snap repository from your machine and even the Ubuntu software center. Henceforth, you won’t have snap package recommendations and neither suggestions. Again, if you try to install the Chromium browser, Ubuntu would now ask you to download snap as a package dependency.
Step 5: Put snap on hold
After we have uninstalled snap and all its preferences, you can put the snap package on hold. Holding a package prevents it from being installed or upgraded automatically. You know, just in case, like chromium.
sudo apt-mark hold snapd
So, you would be better off downloading Chromium from the Debian repo. However, this would eliminate the auto-update of the Chromium browser but would surely keep you off snap. For more issues or queries, let me know in the comments below.