Reason: Package Manager dpkg Already Used-泓源视野

Reason: Package Manager dpkg Already Used

The package manager executes some configuration files while installing or removing some packages from the operating system. If dpkg does not properly compile required files due to involvement in installing any other application, the error will generate.

Reason: Package Manager dpkg Already Used插图

Solution 1: Wait for Running Process

One of the best solutions is to just wait for the execution of processes that are currently run. After the completion, you can execute the required command in the terminal.

Solution 2: Kill Running Process

An alternative solution is also available to stop the running process from generating the error. To display the list of the running processes is possible by following the below procedure:

Display Running Process

The “ps” command is utilized to display the running processes by utilizing the “grep” that matches the pattern which is executing with “apt”. For this, execute the below script:

$ ps aux | grep -i apt
Reason: Package Manager dpkg Already Used插图1

In our case, you can visualize the list of running processes such as “VLC” has process id “3770” that causes the waiting error.

Or

Also, you can find out the running dpkg packages by following the below script:

$ ps aux | grep -i dpkg
Reason: Package Manager dpkg Already Used插图2

Or

Another way to locate the running process id is possible through the “lsof” command. It displays the list of the open files on which the particular process is running:

$ sudo lsof /var/lib/dpkg/lock
Reason: Package Manager dpkg Already Used插图3

Kill Specific Process via ID

To kill the “vlc” process, the “kill” command is utilized with the “-9” signal that kills the running process whose id is “3770”:

$ sudo kill -9 3770
Reason: Package Manager dpkg Already Used插图4

You can verify that the “vlc” process whose id “3770” has been successfully killed as seen below:

$ ps aux | grep -i apt
Reason: Package Manager dpkg Already Used插图5

Solution 3: Remove the Lock File

One of the solutions to tackle the error is possible to remove the “lock-frontend” file that generates the error. These files do not permit change of the system files during the execution of any process (installing or uninstalling packages). To remove the “lock-frontend”, the “rm” command is utilized specifying the path directory:

$ sudo rm /var/lib/dpkg/lock-frontend
Reason: Package Manager dpkg Already Used插图6

Update Debian Package Manager

To apply the changes, execute the below script for updating the Debian package as below:

$ sudo dpkg --configure -a
Reason: Package Manager dpkg Already Used插图7

After executing the above process, update the repository using the root privilege “sudo” via the below command:

$ sudo apt update
Reason: Package Manager dpkg Already Used插图8

That is all from the guide.

Conclusion

The error “waiting for cache lock ubuntu var/lib/dpkg/lock-frontend” occurs due to the involvement of the dpkg package manager in another running process. It can be resolved by waiting for the executing process or killing the running process via process name or PID. This guide will demonstrate all possible solutions to resolve errors in the Ubuntu operating system.

本文由 泓源视野 作者:admin 发表,其版权均为 泓源视野 所有,文章内容系作者个人观点,不代表 泓源视野 对观点赞同或支持。如需转载,请注明文章来源。
70
admin

发表评论

Protected with IP Blacklist CloudIP Blacklist Cloud
您是第8235606 位访客, 您的IP是:[3.94.202.151]