Sudo apt-Get update failed to update source

Source: Internet
Author: User

E: cocould not get lock/var/lib/APT/lists/lock-open (11: Resource temporarily unavailable)

 

 

This problem may occur because another program is running and the resource is locked and unavailable. The reason for the resource being locked may be that the last installation was not completed properly, resulting in this situation.

Solution: Enter the following command.

Sudo RM/var/Cache/APT/archives/lock

Sudo RM/var/lib/dpkg/lock

Then install the package you want to install.

 

 

When I was playing Ubuntu today, the following error suddenly occurred while updating the source:

Sudo apt-Get update
E: cocould not get lock/var/lib/APT/lists/lock-open (11: Resource temporarily unavailable)
E: Unable to lock the List Directory

At first, I thought that the permission was not enough. I used sudo apt-Get update to find or report an error. The problem was not solved. So I searched the internet and the answer was as follows:

The problem should be that the previous update was forcibly canceled, and the process is still running. Run the following command to View Details:

PS-E | grep Apt

The result is as follows:

6362? 00:00:00 Apt

6934? 00:00:00 apt-Get

7368? 00:00:00 synaptic

Then execute

Sudo killall Apt

Sudo killall apt-Get

Sudo killall synaptic

Check PS-E | grep apt again on the terminal. No result is returned.

Continue executing sudo apt-Get update

OK!

 

 

 

Cause: the newly installed ubantu system lacks many software sources. In this case, the system will automatically start the software source update process "apt-Get" and keep it alive. Because it occupies the system lock when the software source is updated (hereinafter referred to as "system update lock ", this lock file is in the "/var/lib/APT/lists/" Directory), and when a new apt-Get process is generated, the error message "E: cannot obtain lock/var/lib/APT/lists/lock-open (11: Resource temporarily unavailable)" is displayed because the system update lock is not obtained! Therefore, we only need to kill the original apt-Get process and activate the new apt-Get process, so that the new lide software manager can work normally!

In this case, you can follow the steps below to solve the problem:
1. Enter the following command: "PS-Aux> temp.txt". Press enter to confirm. In this case, "warning" appears, but ignore it.
2. Enter the following command: "grep-N apt-Get temp.txt" and press enter to confirm. Then, find the PID of the apt-Get process from the command output.
3. Enter the following command: "sudo kill <pid> ".
4. Complete.

Or

If the error message is displayed: e: cocould not get lock/var/lib/dpkg/lock-open (11 Resource temporarily unavailable)

Input

Sudo RM/var/lib/APT/lists/lock

Good luck!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.