I have recently upgraded my OS to Ubuntu 18.04 (fresh install via boot device). However, when trying the command:
sudo apt-get upgradeIt 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.
45 Answers
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 5 Workaround for Ubuntu 18.10:
sudo dpkg -r snapd gnome-software-plugin-snap
sudo apt update
sudo apt full-upgrade 2 I ended up with this issue on the ubunt 20.04 pre-release.
For me, sudo service snapd stop made apt able to finish the upgrade. Might not work on other releases though...
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.
1I had the same issue and didn't want to force stop on apt-get upgrade that causes dpkg lock error.
I opened another terminal and used: ps -aux | grep snapd to identify and kill process that stuck upgrade. For my case it was snapd.postinst.
Then upgrade progressed and ended with error Sub-process /usr/bin/dpkg returned an error code (1).
Then I tried Andrea Draghetti's answer without the first command but again snapd was stuck at installation! So I had to sudo apt purge snapd and live without it from now on.