Thursday, July 25, 2019

upgrade - Apt-get could not open lock - permanently




After running apt-get update I receive the following errors:



E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
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?



I tried what is written here:



rm /var/lib/apt/lists/lock


In this case I'm able to run apt-get upgrade successfully. But after a reboot the issue is return.



I searched for the problem. But I didn't find a solution. A tried what is written here, but I have no output for ps -aux | grep 'apt-get'.




I use Ubuntu 16.10.



The problem



When the system is starting, Ubuntu checks for new security (and sometimes regular) updates. That can take a little while. While it checks, other Apt-related actions are prevented.



How to stop automatic checks for updates



It's not recommended to do this because it stops automatic installation of security fixes if you have those turned on, and it will prevent Ubuntu from telling you when there are updated software packages, but you can stop it from doing that:





  1. Run the System Settings application

  2. Go into Software & Updates

  3. Go to the Updates tab

  4. Switch Automatically check for updates to Never


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...