I have a brand new (1 day old) Ubuntu server 19.04 and after a day I tried to upgrade it. It freezes the terminal with the following error:
ubuntu@ubuntu:~$ sudo apt-get upgrade
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
ubuntu@ubuntu:~$ sudo dpkg --configure -a
Setting up snapd (2.39.2+19.04) ...
md5sum: /etc/apparmor.d/usr.lib.snapd.snap-confine: No such file or directory
AppArmor parser error for /etc/apparmor.d/usr.lib.snapd.snap-confine.real in /etc/apparmor.d/tunables/global at line 17: Could not open 'tunables/proc'
snapd.failure.service is a disabled or a static unit, not starting it.
snapd.snap-repair.service is a disabled or a static unit, not starting it.
As an aside, when pasting in the output of something please make sure itâs pasted as âpre-formatted textâ or âcodeâ, so itâs easier to scan. Iâve done that for you this time.
The mention of tunables/proc refers to /etc/apparmor.d/tunables/proc which is in package apparmor. What does dpkg -l apparmor say?
Your main problem is not about the snapd package itself, but that something interrupted an upgrade. Please take steps to make sure that doesnât happen.
As I see there arenât any snap installed. But then why is the initial error?
ubuntu@ubuntu:~$ snap list
No snaps are installed yet. Try âsnap install hello-worldâ.
Ok, so letâs try this: sudo dpkg -P snapd. This will purge the snapd package, which should also trigger the configure and help it sort things out. Thereâs probably some other error lurking but maybe itâll fix itself. Then we can sudo apt install snapd to get things back to where they were.
ubuntu@ubuntu:~$ sudo dpkg -P snapd
(Reading database ... 66934 files and directories currently installed.)
Removing snapd (2.39.2+19.04) ...
Purging configuration files for snapd (2.39.2+19.04) ...
Final directory cleanup
Discarding preserved snap namespaces
Removing extra snap-confine apparmor rules
Removing snapd cache
Removing snapd state
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
ubuntu@ubuntu:~$ sudo apt install snapd
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
zenity | kdialog
The following NEW packages will be installed:
snapd
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
12 not fully installed or removed.
Need to get 0 B/13.1 MB of archives.
After this operation, 62.4 MB of additional disk space will be used.
Selecting previously unselected package snapd.
(Reading database ... 66862 files and directories currently installed.)
Preparing to unpack .../snapd_2.39.2+19.04_amd64.deb ...
Unpacking snapd (2.39.2+19.04) ...
Setting up snapd (2.39.2+19.04) ...
md5sum: /etc/apparmor.d/usr.lib.snapd.snap-confine: No such file or directory
AppArmor parser error for /etc/apparmor.d/usr.lib.snapd.snap-confine.real in /etc/apparmor.d/tunables/global at line 17: Could not open 'tunables/proc'
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.autoimport.service â /lib/systemd/system/snapd.autoimport.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.core-fixup.service â /lib/systemd/system/snapd.core-fixup.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.seeded.service â /lib/systemd/system/snapd.seeded.service.
Created symlink /etc/systemd/system/cloud-final.service.wants/snapd.seeded.service â /lib/systemd/system/snapd.seeded.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.service â /lib/systemd/system/snapd.service.
Created symlink /etc/systemd/system/timers.target.wants/snapd.snap-repair.timer â /lib/systemd/system/snapd.snap-repair.timer.
Created symlink /etc/systemd/system/sockets.target.wants/snapd.socket â /lib/systemd/system/snapd.socket.
Created symlink /etc/systemd/system/final.target.wants/snapd.system-shutdown.service â /lib/systemd/system/snapd.system-shutdown.service.
snapd.failure.service is a disabled or a static unit, not starting it.
snapd.snap-repair.service is a disabled or a static unit, not starting it.
Setting up libsqlite3-0:amd64 (3.27.2-2ubuntu0.1) ...
Setting up libisc1100:amd64 (1:9.11.5.P1+dfsg-1ubuntu2.5) ...
Setting up liblwres161:amd64 (1:9.11.5.P1+dfsg-1ubuntu2.5) ...
Setting up libisc-export1100:amd64 (1:9.11.5.P1+dfsg-1ubuntu2.5) ...
Setting up libisccc161:amd64 (1:9.11.5.P1+dfsg-1ubuntu2.5) ...
Setting up libdns-export1104 (1:9.11.5.P1+dfsg-1ubuntu2.5) ...
Setting up libdns1104:amd64 (1:9.11.5.P1+dfsg-1ubuntu2.5) ...
Setting up libisccfg163:amd64 (1:9.11.5.P1+dfsg-1ubuntu2.5) ...
Setting up libbind9-161:amd64 (1:9.11.5.P1+dfsg-1ubuntu2.5) ...
Setting up libirs161:amd64 (1:9.11.5.P1+dfsg-1ubuntu2.5) ...
Setting up bind9-host (1:9.11.5.P1+dfsg-1ubuntu2.5) ...
Setting up dnsutils (1:9.11.5.P1+dfsg-1ubuntu2.5) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for libc-bin (2.29-0ubuntu2) ...
Processing triggers for man-db (2.8.5-2) ...