11

I have recently upgraded my OS to Ubuntu 18.04 (fresh install via boot device). However, when trying the command:

sudo apt-get upgrade

It works fine until ~75% when it stops and says:

snapd.snap-repair.service is a disabled or a static unit, not starting it.

I'm not quite sure what this means and if I Crtl-Z to get out of it, any time I try to install anything I get:

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

and have to restart my computer to install anything.

  • 2
    With CTRL-Z you just suspend (pause) the apt-get program but it still holds a lock in /var/lib/dpkg/lock which prevents you from starting it a 2nd time. Hit CTRL-C instead of Z to actually stop and end the apt-get process. – PerlDuck May 17 '18 at 14:35
  • 1
    Also, snapd.snap-repair.service is a disabled or a static unit, not starting it. doesn't look like an error, but it seems to be just an info message. I'd recommend waiting for the process to end, and if it doesn't, please add the full log output of the apt command. – Dan May 17 '18 at 14:38
  • @Dan So I run: $sudo apt-get upgrade$ I get: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. So then i try that command to get the error I was previously referring to in my original post. If I ctrl-C to try to quit at that point, I get a bunch of stuff that won't fit in this comment and this error at the end: Errors were encountered while processing: snapd – Physics May 17 '18 at 17:50
  • @JustinRoberts There are issues with your packages, unfortunately, we can't help out if we can't get more details about the error :(. Can you please edit your post to include the output of the command? You can use paste.ubuntu.com if the log is very large. – Dan May 21 '18 at 10:27
17

I also had the same problem and I solved it like this:

sudo fuser -vki /var/lib/dpkg/lock
sudo apt purge snapd
sudo dpkg --configure -a
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt install snapd
  • This should be the accepted solution. First line could also be replaced by sudo pkill snapd.postinstall but yours is more general. – rosch Jun 26 '18 at 12:41
  • 1
    Thanks, worked for me Ubuntu 18.04. – Darkmoor Jul 28 '18 at 9:12
  • It also works on Ubuntu 19.04. Thank you. – jplandrain Aug 10 at 14:18
8

Workaround for Ubuntu 18.10:

sudo dpkg -r snapd gnome-software-plugin-snap
sudo apt update
sudo apt full-upgrade
  • Not working for me using apt-get instead of apt. – rosch Jun 26 '18 at 12:38
  • work great for 18.10 cosmic cuttlefish – cedric.walter Aug 22 '18 at 9:11
1

I just noticed the same thing. Fresh install.

And as I'm writing this, the installation just continued after about 10 minutes.

I don't know what the update process was waiting for, but patience resolved the issue.

  • I don't think that's the best option, but it can be a temporary one. On Ubuntu 18.10 this doesn't seem to work. – rosch Jun 26 '18 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.