Remove Snap Packages in Ubuntu

Remove Snap Packages in Ubuntu
Photo by jom jakkid / Unsplash
  1. List Snap packages
    michi@vertanet:~$ snap list
    Name    Version        Rev    Tracking       Publisher   Notes
    core20  20230308       1852   latest/stable  canonical✓  base
    lxd     5.0.2-838e1b2  24322  5.0/stable/…   canonical✓  -
    snapd   2.58.3         18596  latest/stable  canonical✓  snapd
    
  2. Remove Snap packages
    michi@vertanet:~$ sudo snap remove --purge lxd
    lxd removed
    michi@vertanet:~$ sudo snap remove --purge core20
    core20 removed
    michi@vertanet:~$ sudo snap remove --purge snapd
    snapd removed
    
  3. Remove Snap deamon
    michi@vertanet:~$ sudo apt remove --autoremove snapd
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following packages will be REMOVED:
      snapd squashfs-tools ubuntu-server-minimal
    0 upgraded, 0 newly installed, 3 to remove and 1 not upgraded.
    After this operation, 103 MB disk space will be freed.
    Do you want to continue? [Y/n]
    (Reading database ... 109469 files and directories currently installed.)
    Removing ubuntu-server-minimal (1.481) ...
    Removing snapd (2.58+22.04) ...
    Warning: Stopping snapd.service, but it can still be activated by:
      snapd.socket
    Removing squashfs-tools (1:4.5-3build1) ...
    Processing triggers for dbus (1.12.20-2ubuntu4.1) ...
    Processing triggers for man-db (2.10.2-1) ...
    
  4. Create apt preference file
    michi@vertanet:~$ sudo vim /etc/apt/preferences.d/nosnap.pref
    Package: snapd
    Pin: release a=*
    Pin-Priority: -10
    michi@vertanet:~$ sudo apt update
    

Read more

Me on Mastodon - This link is here for verification purposes.