9/16/2023 0 Comments Lock error sudo apt get install![]() Next, update your packages sources list as follows: $ sudo apt update Important: In case a lock is still exiting in the two directories above with no noticeable apt-get or apt process running, this may mean the process was held for one reason or the other, therefore you need to delete the lock files in order to clear the error.įirst execute the command below to remove the lock file in the /var/lib/dpkg/ directory: $ sudo rm /var/lib/dpkg/lockĪfterwards force package(s) to reconfigure like so: $ sudo dpkg -configure -aĪlternatively, delete the lock files in the /var/lib/apt/lists/ and cache directory as below: $ sudo rm /var/lib/apt/lists/lock When the process has finished executing, the lock file is then deleted. This helps to avoid the apt-get or apt process that is already running from being interrupted by either a user or other system processes that would need to work with files being used by apt-get or apt. Once you run an apt-get or apt command, a lock file is created under the any of these directories /var/lib/apt/lists/, /var/lib/dpkg/ and /var/cache/apt/archives/. $ sudo kill -9 processnumberįor instance, in the command below where 9 is the signal number for the SIGKILL signal, will kill the first apt process: $ sudo kill -9 13431Ī lock file simply prevents access to another file(s) or some data on your Linux system, this concept is present in Windows and other operating systems as well. The process ID ( PID) is found in the first column from the screenshot above. $ ps -A | grep aptįor each apt-get or apt process that you can see in the output of the command above, kill each process using the command below. Run the command below to generate a list of all processes whose name comprises of the word apt, you will get a list inclusive of all apt or apt-get processes by using ps and grep commands together with a pipeline. Find and Kill all apt-get or apt Processes How can you solve the above error in case you bump into it in the future? There are several ways of dealing with this error(s), but in this guide, we will go through the two easiest and probably the most effective ways of solving it. The output below is another possible instance of the same error: E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)Į: Unable to lock directory /var/lib/apt/lists/Į: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? This error can be so annoying especially for new Linux (Ubuntu) users who may not know exactly the cause of the error.īelow is an example, showing the lock file error in Ubuntu 16.10: :~$ sudo apt install neofetchĮ: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)Į: Unable to lock the administration directory (/var/lib/dpkg), is another process using it? While using the apt-get command or the relatively new APT package management tool in Ubuntu Linux or its derivatives such as Linux Mint (which I actually use as my primary operating system for doing daily work), you might have encountered the error – “ unable to lock the administration directory (/var/lib/dpkg/) is another process using it” on the command line. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |