Tag Archives: /var/lib/apt/lists/lock – open (11

E: Unable to get lock / var / lib / apt / lists / lock – Open (11 resources temporarily unavailable)

Check whether there is a program using apt get. Enter PS – aux at the terminal, find the program using apt get (the last column), check its PID number, then kill its process, and enter sudo kill PID

When using sudo apt get update, the error “E: unable to get lock/var/lib/apt/lists/lock” appears

The solution found on the Internet – “just delete/var/lib/apt/list/lock” – is actually an extreme case, that is, it is used when the last update is not normally closed

In most cases, the cause of the problem is that other programs, such as system automatic update, xinlide, are using apt get process, so the solution is to close this process

E: Unable to get lock/var/lib/apt/lists/lock – Open (11 resource temporarily unavailable e: unable to get lock/var/lib/apt/lists/lock – Open (11 resource temporarily unavailable)

The details are as follows:

1. PS aux finds out the PID of apt get process, which is usually a four digit number

2. Killing process with sudo kill PID code

3. Upgrade with sudo apt get update and sudo apt get dist upgrade

Method 1

Execute sudo dpkg — configure – A

Method 2 (the parent test can be used)

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

Method 3

1. PS aux finds out the PID of apt get process

2. Use sudo kill PID code to kill the process (I always find the process with apt to kill it)

—————————Dividing line—————————

E:Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable)

The reason for this problem may be that another program is running, causing the resource to be locked and unavailable. The reason for the resource being locked may be that the last installation did not complete normally, resulting in this situation

Solution: enter the following command

sudo rm /var/cache/apt/archives/lock

sudo rm /var/lib/dpkg/lock

After that, you can install the package you want to install

When I was playing Ubuntu today, when I was updating the source, I suddenly made the following error:

[1]+ Stopped sudo apt-get update www.linuxidc.com@linux :~$ sudo apt-get update E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable) E: Unable to lock the list directory

At first, I thought it was due to insufficient permissions. I just used sudo apt get update. When I found out, I still reported an error. The problem was not solved. So I searched the Internet

The problem should be that the previous update was forcibly cancelled, and the process is still in progress. Use this command to see:

ps -e | grep apt

The results are as follows:

6362 ? 00:00:00 apt

6934 ? 00:00:00 apt-get

7368 ? 00:00:00 synaptic

And then it’s done

sudo killall apt

sudo killall apt-get

sudo killall synaptic

Check PS – e | grep apt again in the terminal, and there is no result

Continue sudo apt get update

OK!

Reason: the newly installed ubantu system lacks many internal software sources. At this time, the system will automatically start the software source update process “apt get”, and it will always survive. When it is running, it will occupy the system lock when the software source is updated (hereinafter referred to as “system update lock”, the lock file is in the directory of/var/lib/apt/lists /). When a new apt get process is generated, the error prompt “E: unable to obtain lock/var/lib/apt/lists/lock – Open (11: resource temporarily unavailable)” will appear because the system update lock cannot be obtained! Therefore, as long as we kill the original apt get process and reactivate the new apt get process, we can make xinlide software manager work normally

At this time, you can solve the problem by following the steps: 1. Enter the following command: “PS – aux > Click enter to confirm. At this time, there will be “warning”, but ignore it. 2. Enter the following command: “grep – N apt get temp. TXT” type enter to confirm. Then find the PID of apt get process from the command output. 3. Enter the following command: “sudo kill & lt; PID>”。 4. Done

or

If the prompt is wrong: e: could not get lock/var/lib/dpkg/lock – Open (11 resource temporarily unavailable), enter sudo RM/var/lib/apt/lists/lock

Good luck

—————————Dividing line—————————

linuxidc@ubuntu :~$ sudo apt-get update E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ linuxidc@ubuntu :~$ sudo apt-get update E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib /apt/lists/ linuxidc@ubuntu :~$ sudo apt-get update E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ linuxidc@ubuntu :~$ sudo apt-get update E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ linuxidc@ubuntu :~$

linuxidc@ubuntu :~$ sudo rm /var/cache/apt/archives/lock linuxidc@ubuntu :~$ sudo rm /var/cache/apt/archives/lock rm: cannot remove ‘/var/cache/apt/archives/lock’: No such file or directory linuxidc@ubuntu :~$ sudo rm /var/lib/dpkg/lock linuxidc@ubuntu :~$