Ubuntu – Do NOT delete the lock file if you see a ‘could not get lock’ when trying to install an app.
I was trying to install ClamAv on two of my Ubuntu machines. I got a ‘could not get lock’ error. A lot of the posts I found said to delete /var/lib/dpkg/lock. DO NOT DO THIS UNTIL YOU EXHAUST ALL OTHER OPTIONS.
I wanted to install clam AV. I received the following error:
chris@chris-VirtualBox:~$ sudo apt install clamav
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?
The posts I found had a number of steps to take including deleting the lock file. I started to think about the situation. Both machines hadn’t been used in a couple of days. One is an Ubuntu laptop and the other is a virtual machine running Ubuntu under Windows 10. It dawned on me that the problem might simply be that automatic updates had locked the lock file.
I filled up my coffee (decaf this time) and tried again. Sure enough, the installs of ClamAV and ClamTk went smoothly.
Takeaway: If you get a ‘could not lock’ error simply wait about 10 to 15 minutes and try again. It might just be the result of auto updates.
- A second lease on life for old PCs with Linux (Ubuntu)
- Oracle’s Virtual Box – virtual machine for windows
- Managing Multiple Ruby Versions in Windows
- Creating a USB stick to install Ubuntu using Rufus
- Microsoft is ending support for Windows XP on 4 8 2014
- Workaround for scanning issues with a Sharp MX-C311 and WIndows 7
- A Windows 10 patch that is supposed to address Meltdown and Spectre vulnerabilities. BEWARE IF YOU HAVE AN AMD PROCESSOR
- Vista home and automatic restart after downloading updates