In Ubuntu / Linux Mint / Debian and others Debian based Linux distributions, when an installation with apt-get freezes, the apt install managere gets locked.
This is the error you get when an installation fails:
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
To unlock the package apt manager, you need to delete this two files: /var/lib/apt/lists/lock and /var/cache/apt/archives/lock.
$ sudo rm /var/apt/lists/lock
$ sudo rm /var/cache/apt/archives/lock
Thanks so much for this! I am a complete linux beginner and would be lost without articles like this.
The commands I ran:
$ sudo rm /var/lib/apt/lists/lock
$ sudo rm /var/cache/apt/archives/lock