/var/lib/dpkg/lock

 

Bad memory:

Could not get lock /var/lib/dpkg/lock

Locked file blocks access to certain files or data Linux system, this concept also exists in Windows or other operating systems.

    Once you run the command apt-get or apt, locked files will be created in , ,  in. /var/lib/apt/lists//var/lib/dpkg//var/cache/apt/archives/

    This helps run the apt-get or apt process can be avoided by other users or system processes need to use the same files interrupted. When this process is finished, the lock file will be deleted.

    and so:

      1: Remove the lock files in the corresponding directory:

      2: Force reconfiguration of the package:

      3: Update package source files:

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

sudo rm /var/lib/dpkg/lock

sudo dpkg --configure -a
 sudo apt update
 
ps afx|grep apt
 3284 pts/0    S+     0:00          \_ grep --color=auto apt
 2869 ?        Ss     0:00 /bin/sh /usr/lib/apt/apt.systemd.daily install
 2873 ?        S      0:00  \_ /bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held install
View Code

 

Guess you like

Origin www.cnblogs.com/gary-guo/p/11387523.html