Sudo apt-get upgrade error

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.

What’s the problem? Please someone help me.

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.

Sorry, I’m new here. Here is the result:

ubuntu@ubuntu:~$ dpkg -l apparmor
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version         Architecture Description
+++-==============-===============-============-======================================
ii  apparmor       2.13.2-9ubuntu6 amd64        user-space parser utility for AppArmor

and dpkg -S tunables/proc ?

ubuntu@ubuntu:~$ dpkg -S tunables/proc
apparmor: /etc/apparmor.d/tunables/proc

Very curious. Maybe it’s sorted itself out despite erroring? What happens if you try sudo apt upgrade again?

ubuntu@ubuntu:~$ sudo apt upgrade
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

Do you have any snaps installed? (what’s the output of snap list?)

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) ...

Next move? sudo apt upgrade?

Looks like you’re sorted. Try the update/upgrade, but the install wouldn’t’ve worked if you had still been stuck. Good luck!

1 Like

Thanks! It all worked!

1 Like