10

I have just installed Ubuntu MATE 21.10 and discovered two interesting packages which contain snapd in the name - gir1.2-snapd-1 and libsnapd-glib1:

$ dpkg -l | grep snapd
ii  gir1.2-snapd-1:amd64                     1.58-0ubuntu2                       amd64        Typelib file for libsnapd-glib1
ii  libsnapd-glib1:amd64                     1.58-0ubuntu2                       amd64        GLib snapd library

Both came from snapd-glib package.

Removal of them will ruin the system as follows:

$ sudo apt autopurge gir1.2-snapd-1:amd64 libsnapd-glib1:amd64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  apturl* apturl-common* ayatana-indicator-sound* bluez-cups* cups* cups-browsed* cups-core-drivers* cups-daemon* cups-server-common*
  gir1.2-goa-1.0* gir1.2-snapd-1* hplip* hplip-data* libcanberra-pulse* libcupsimage2* libgutenprint-common* libgutenprint9* libhpmud0*
  libimagequant0* libpulsedsp* libsane-hpaio* libsbc1* libsnapd-glib1* libspeexdsp1* printer-driver-gutenprint* printer-driver-hpcups*
  printer-driver-postscript-hp* printer-driver-splix* pulseaudio* pulseaudio-module-bluetooth* pulseaudio-utils* python3-dateutil* python3-debconf*
  python3-olefile* python3-pil* python3-renderpm* python3-reportlab* python3-reportlab-accel* python3-software-properties* rtkit*
  software-properties-common* software-properties-gtk* ssl-cert* ubuntu-mate-core* ubuntu-mate-desktop* ubuntu-release-upgrader-gtk* update-manager*
  update-notifier* update-notifier-common*
0 upgraded, 0 newly installed, 49 to remove and 0 not upgraded.
After this operation, 49,3 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.

Is it possible to remove gir1.2-snapd-1 and libsnapd-glib1 packages without ruining the system?

N0rbert
  • 97,162
  • 34
  • 239
  • 423
  • Just out of curiosity, is there a particular reason that you want to remove those 2 particular packages? Are they causing problems? –  Nov 17 '21 at 00:41
  • So I just ran that same command, I'm running 20.04. The command returns different output specific to 20.04, but they are clearly base packages, personally I do not recommend removing base packages for any reason. I tried a locate of specific files, no way I would ever think of dong this myself, so I wouldn't tell anyone else EVER to do such a thing. –  Nov 17 '21 at 00:56
  • 5
    I have no clue what the snap developers are trying to achieve. Now, even packages for sound, bluetooth and printing depend on things related to snapd. – Archisman Panigrahi Nov 19 '21 at 07:59
  • 5
    @ArchismanPanigrahi they are desperately trying to keep people from removing it. If it gets to the point that I can't remove it without breaking the system, it's goodbye Ubuntu. So far 20.04 is OK. – Organic Marble Nov 20 '21 at 00:54
  • So snap seems to be a new thing in 20.04, I wonder if there's a way to revert it back by removing `snapd` and replacing it with the "original packages" whatever they were. If you could find a previous version and compare the packages between the two distros. That's something else I would try if I were in a jam and wanted try something for myself. Again only in test/virtual environment. –  Nov 20 '21 at 01:57

2 Answers2

4

These packages are designed to allow applications to communicate with snapd. One accordingly would believe that these packages are not of any use of snapd is not anymore installed. However, in order for an app to be able to communicate with snapd, the app must be compiled with support for these libraries. These libraries thus become a hard dependency of these apps, and must stay on the system even if snapd is removed.

That is the technical reason. However, what functionality (non-snap) applications gain by being able to access snapd is unclear. All descriptions of what the libraries do boil down to

snapd-glib is a library to allow GLib based applications access to snapd, the daemon that controls Snaps.

Possibly, these are what would allow these apps to access to the Snapd REST API in order to interact with snapd.

vanadium
  • 82,909
  • 6
  • 116
  • 186
-3

remove snap

Find installed snaps: snap list

Remove installed snaps: sudo snap remove <package>

Remove snapd: sudo apt purge snapd

Remove snap directory from home: rm -rf ~/snap

If you receive an error removing snapd then do the following : sudo rm -rf /var/cache/snapd then run sudo apt purge snapd