Search code examples
configuredpkg

`dpkg --configure -a` hangs


I'm using Ubuntu 16.04.

When I update, I got the following message

$ sudo apt-get update
....
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

Following the error message, I try

$ sudo dpkg --configure -a
setting up snapd (2.14.2~16.04) ...

then it hangs forever. Does anybody know how can I fix this problem? Thanks.


Solution

  • This is a confirmed bug.

    https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1621336

    A workaround is listed:

    https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1621336/comments/4

    Adding the workaround from Axel Kämpfe since the links seems to be broken:

    1. Start a rootshell with "sudo -i"
    2. Run echo "bash -c 'service snapd.boot-ok start'" | at now + 4 min
    3. Then run apt install snapd (if it argues about canceled dpkg processes use the dpkg --configure -a. Then wait for at least 4 minutes. The hanging should gone then.

    Good luck! :)

    /Patrik