E: Could not get lock / var / lib / apt / lists / lock - open - Troubleshooting

Last update April 8, 2023 at 08:28 AM

In this troubleshooting we will try to solve the problem E: Could not get lock /var/lib/apt/lists/lock – open which is displayed in your terminal ubuntu.

While trying to install an application in ubuntu we encountered the following error:

E: Could not get lock / var / lib / apt / lists / lock

This error indicates that the package list is blocked by the command apt when we had stopped the order. This type of error often comes up when this program is improperly closed.

The solution we are going to offer you can be applied to any type of error containing a * lock to manage that you encounter under a linux. Let's see the solution.

E: Could not get lock / var / lib / apt / lists / lock - Troubleshooting

To resolve this error, you must first ensure that the blocking software is indeed stopped. In our case it is a question of checking if there are no packages being installed.

When you have confirmed that the software blocking your command has stopped working, you can start by deleting the file lock on the next line.

sudo rm -r / var / lib / apt / lists / lock


This command works for both files like lock folders. We do not know if the lock folder exists but we preferred a complete command rather than handling special cases.

Instead of / var / lib / apt / lists / lock, you may have to manage / var / lib / dpkg / lock or other path in the form of / to / the / file / lock. In all cases, it suffices to adapt the following terminal line:

sudo rm -r path / to / the / file / lock

This command works with any kind of linux based system.

Auteur: Zetaplus

Last update April 8, 2023 at 08:28 AM

E: Could not get lock / var / lib / apt / lists / lock - open - Troubleshooting