How to fix : E: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)

If you are trying to install some package on ubuntu and by some means, in middle of the installation, some unexpected things happens causing installation to abort in the middle, in similar situation if you try to install the same package later on, you may see an error like below,

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?

If you see the lock file using “file /var/lib/dpkg/lock” command, its an empty file, but used as a lock to avoid multiple installations simultaneously.

Solution : To remove this error, we need to manually remove this file as,

 $ sudo rm -rf /var/lib/dpkg/lock 

Now, if you try to install the same or any other package again, you will not see the above error and installation happens successfully.

Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home HTML JAVA Programs Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply