I have created this blog to place some of important things on it for my personal use and also to help others. Now a days I am doing job as Software Engineer in a company. I have completed my graduation in Computer Science from University of Sindh, Jamshoro, Pakistan.
Tuesday, July 26, 2016
Could not get lock /var/lib/dpkg/lock
Today, I tried to install Git on my Ubuntu machine and during that I received following exception related to locking. In my this post, I have shared all commands and error messages with you.
Command sudo apt-get install git
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?
After searching above message, I found a command
sudo lsof /var/lib/dpkg/lock
after pressing ENTER, it might asked you for password. Type the password and in result you might get following output
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME