Thursday, August 21, 2014

How to fix could not get lock error in debian

If you try to get ubuntu update by apt-get update command and you get these errors could not get lock /var/lib/apt/lists/lock or Could not get lock /var/lib/dpkg/lock. I will show you how to fix this problem in this article.
Could not get lock error happens when:
  • you try to run or execute an apt command but forget to use “sudo”
  • something has locked the apt database after install or remove software
  • you try to use apt-get while running Ubuntu Software Center
  • two apt-get commands at the same time
  • run apt-get commands while applications is updating in the background automatically
You can wait for the processes to be completed, but sometimes those processes just hang there.
These applications or commands that cause could not get lock error problems.
  • Apt command
  • Ubuntu Software Center
  • Update Manager
You will likely to see these errors
or
You can fix that problem by simply remove all of the temporary list in /var/lib/apt/lists/ and lock file in the cache directory in /var/cache/apt/archives/lock
Now we should force package to reconfig
Now you can try to update your Ubuntu system or run Synaptic without “could not get lock” error.

No comments:

Post a Comment