apt-get purge snapd does not clear /var/lib/snapd

Bug #1573767 reported by Alexander Sack
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

after purge i still have:

$ sudo apt-get purge snapd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  snapd*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 19.0 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 507196 files and directories currently installed.)
Removing snapd (2.0.2) ...
Purging configuration files for snapd (2.0.2) ...
dpkg: warning: while removing snapd, directory '/snap' not empty so not removed
dpkg: warning: while removing snapd, directory '/var/snap' not empty so not removed
dpkg: warning: while removing snapd, directory '/var/lib/snapd/apparmor' not empty so not removed
dpkg: warning: while removing snapd, directory '/var/lib/snapd/snaps' not empty so not removed
Processing triggers for man-db (2.7.5-1) ...
asac@bigos:~$ ls -ls /var/lib/snapd/
total 24
4 drwxr-xr-x 3 root root 4096 Apr 22 21:39 apparmor
4 drwxr-xr-x 4 root root 4096 Apr 22 21:37 assertions
4 drwxr-xr-x 3 root root 4096 Apr 22 21:37 desktop
4 drwxr-xr-x 3 root root 4096 Apr 22 21:37 seccomp
4 drwxr-xr-x 2 root root 4096 Apr 22 21:37 snaps
4 -rw------- 1 root root 2403 Apr 22 21:37 state.json

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapd (Ubuntu):
status: New → Confirmed
Revision history for this message
Phil P (pgpndw) wrote :

Some other cruft is also left after snapd is purged:

$ sudo apt-get purge snapd
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED
  snapd*
0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade.
After this operation, 23.0 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 177595 files and directories currently installed.)
Removing snapd (2.0.10) ...
Warning: Stopping snapd.service, but it can still be activated by:
  snapd.socket
Purging configuration files for snapd (2.0.10) ...
dpkg: warning: while removing snapd, directory '/var/lib/snapd' not empty so not removed
Processing triggers for man-db (2.7.5-1) ...

Left behind are:

Broken symlinks:

$ ls -l /etc/systemd/system/multi-user.target.wants/*snapd*
lrwxrwxrwx 1 root root 39 Jul 15 10:36 /etc/systemd/system/multi-user.target.wants/snapd.refresh.timer -> /lib/systemd/system/snapd.refresh.timer
lrwxrwxrwx 1 root root 33 Jul 15 10:36 /etc/systemd/system/multi-user.target.wants/snapd.service -> /lib/systemd/system/snapd.service

$ ls -l /etc/systemd/system/sockets.target.wants/*snapd*
lrwxrwxrwx 1 root root 32 Jul 15 10:36 /etc/systemd/system/sockets.target.wants/snapd.socket -> /lib/systemd/system/snapd.socket

Files:

$ ls -l /var/lib/systemd/deb-systemd-helper-enabled/*snapd*
-rw-r--r-- 1 root root 64 Jul 15 10:36 /var/lib/systemd/deb-systemd-helper-enabled/snapd.refresh.timer.dsh-also
-rw-r--r-- 1 root root 58 Jul 15 10:36 /var/lib/systemd/deb-systemd-helper-enabled/snapd.service.dsh-also
-rw-r--r-- 1 root root 54 Jul 15 10:36 /var/lib/systemd/deb-systemd-helper-enabled/snapd.socket.dsh-also

$ ls -l /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/*snapd*
-rw-r--r-- 1 root root 0 Jul 15 10:36 /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/snapd.refresh.timer
-rw-r--r-- 1 root root 0 Jul 15 10:36 /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/snapd.service

$ ls -l /var/lib/systemd/deb-systemd-helper-enabled/sockets.target.wants/*snapd*
-rw-r--r-- 1 root root 0 Jul 15 10:36 /var/lib/systemd/deb-systemd-helper-enabled/sockets.target.wants/snapd.socket

$ ls -l /var/lib/systemd/timers/*snapd*
-rw-r--r-- 1 root root 0 Jul 15 10:37 /var/lib/systemd/timers/stamp-snapd.refresh.timer

A socket:

$ ls -l /run/*snapd*
srw-rw-rw- 1 root root 0 Jul 15 10:37 /run/snapd.socket

And the aforementioned directory:

$ ls -laR /var/lib/snapd/
/var/lib/snapd/:
total 12
drwxr-xr-x 3 root root 4096 Jul 15 10:40 .
drwxr-xr-x 72 root root 4096 Jul 15 10:36 ..
drwxr-xr-x 4 root root 4096 Jul 15 10:37 assertions

/var/lib/snapd/assertions:
total 16
drwxr-xr-x 4 root root 4096 Jul 15 10:37 .
drwxr-xr-x 3 root root 4096 Jul 15 10:40 ..
drwxr-xr-x 2 root root 4096 Jul 15 10:37 asserts-v0
drwxr-xr-x 2 root root 4096 Jul 15 10:37 private-keys-v0

/var/lib/snapd/assertions/asserts-v0:
total 8
drwxr-xr-x 2 root root 4096 Jul 15 10:37 .
drwxr-xr-x 4 root root 4096 Jul 15 10:37 ..

/var/lib/snapd/assertions/private-keys-v0:
total 8
drwxr-xr-x 2 root root 4096 Jul 15 10:37 .
drwxr-xr-x 4 root root 4096 Jul 15 10:37 ..

Revision history for this message
Michael Vogt (mvo) wrote :

This is fixed in xenial-updates. apt purge snapd will remove all traces of snapd including all installed snaps and auto-generated files. If you see anything leftover please reopen and with the specific files we missed.

Changed in snapd (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Phil P (pgpndw) wrote :

/var/lib/systemd/timers/stamp-snapd.refresh.timer is still left behind. It seems too petty to reopen the bug report just for that, though.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.