The Issue
We want to disable snapd service on system startup/prevent snapd services startup automatically on system boot on Ubuntu or remove Snap completely
The Fix
1 Disable snap services
1.1 Bring up the terminal or login via SSH
1.2 E1xecute following commands to disable snap services
sudo systemctl disable snapd.service
sudo systemctl disable snapd.socket
sudo systemctl disable snapd.seeded
sudo systemctl disable snapd.snap-repair.timer
1.3 Restart the system
sudo reboot
1.4 Now the snap service will not start on system startup
2 Removing Snap
To uninstall snap (If necessary), we need to make sure snap is not used at all.
If we want to uninstall/remove snap just follow the below steps
2.1 List all snaps
snap list
2.2 If there is any installed snap pckage e.g. bashtop, remove all of them one by one
sudo snap remove bashtop
2.3 Find the snap core service directory ID
df
From the output, under the “Mounted on” column, find the ones with “/snap/core/xxxx”
2.4 Unmount the snap core service
sudo umount /snap/core/xxxx
2.5 Remove all snapd package
sudo apt purge snapd
2.6 Remove all directories (If necessary), be careful with the rm command, we will lose data if done incorrectly
rm -rf ~/snap
sudo rm -rf /snap
sudo rm -rf /var/snap
sudo rm -rf /var/lib/snapd
Comments