[guide] How to completely remove Snap from Ubuntu ?
I have a laptop with Microsoft Windows 11 Pro installed and a WSL with the default Ubuntu distribution. It is preconfigured with Snap package manager. But I am not using Snap in Ubuntu WSL. So I feel the need to remove/purge it.
To completely remove Snap from an Ubuntu distribution in WSL, you must first remove all existing snap packages, then uninstall the snapd daemon, and finally remove leftover directories.
Step 1: List and Remove Snap Packages 🔗
First, list all installed snap packages to identify what needs to be removed.
Open your Ubuntu terminal in WSL and run:
snap list
For each package listed, remove it individually.
core or snapd. After removing all other snap packages, remove core packages and snapd too.For example, if firefox is listed:
sudo snap remove --purge firefox
You may need to disable services for certain snaps (like firefox) if you encounter “read-only file system” errors.
sudo systemctl stop var-snap-firefox-common-host\\x2dhunspell.mount
sudo systemctl disable var-snap-firefox-common-host\\x2dhunspell.mount
Then try removing the package again
sudo snap remove --purge firefox
Step 2: Remove the snapd Daemon 🔗
Once all individual packages are removed, you can remove the main snapd package itself.
Stop and disable the snapd services:
sudo systemctl stop snapd.service
sudo systemctl disable snapd.socket
sudo systemctl disable snapd.service
Purge the snapd package using apt:
sudo apt purge snapd -y
You can also remove the snap plugin for the software store if installed:
sudo apt purge gnome-software-plugin-snap -y
Clean up any unused dependencies:
sudo apt autoremove -y
Step 3: Remove Leftover Directories 🔗
Remove any remaining directories to ensure no traces of snap are left.
Run the following commands:
rm -rf ~/snap
sudo rm -rf /snap
sudo rm -rf /var/snap
sudo rm -rf /var/lib/snapd
sudo rm -rf /var/cache/snapd
sudo rm -rf /usr/lib/snapd
Step 4: Prevent Snap from Reinstalling 🔗
To prevent snapd from being automatically reinstalled by other packages in the future, create a preference file to give it a negative priority.
Create the file using a text editor (like nano):
sudo nano /etc/apt/preferences.d/no-snap.pref
Add the following lines to the file and save it ( Ctrl + O, then ↵ Enter, then Ctrl + X if using nano):
Package: snapd
Pin: release a=*
Pin-Priority: -10
Step 5: Update and Reboot 🔗
Update your package lists:
sudo apt update
Reboot your WSL instance to finalize all changes. In a Windows Command Prompt or PowerShell, run:
wsl --shutdown
Reopen your Ubuntu instance in WSL. Snap should now be completely removed.
I hope you enjoyed reading this post as much as I enjoyed writing it. If you know a person who can benefit from this information, send them a link of this post. If you want to get notified about new posts, follow me on YouTube , Twitter (x) , LinkedIn , and GitHub .