目录
[1.使用apt install安装程序有时会爆出dpkg/lock类故障](#1.使用apt install安装程序有时会爆出dpkg/lock类故障)
[3.使用kill -9命令删除占用进程](#3.使用kill -9命令删除占用进程)
[5. 配置生效](#5. 配置生效)
1.使用apt install安装程序有时会爆出dpkg/lock类故障
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
book@www.100ask.org:/mnt/hgfs/99_github/TinyWebServer$
2.使用lsof命令查看占用锁的进程
book@www.100ask.org:/mnt/hgfs/99_github/TinyWebServer$ sudo lsof /var/lib/dpkg/lock
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
unattende 2861 root 4uW REG 8,1 0 3025283 /var/lib/dpkg/lock
3.使用kill -9命令删除占用进程
book@www.100ask.org:/mnt/hgfs/99_github/TinyWebServer$ sudo kill -9 2861
4.删除锁
book@www.100ask.org:/mnt/hgfs/99_github/TinyWebServer$ sudo rm /var/lib/dpkg/lock
5. 配置生效
book@www.100ask.org:/mnt/hgfs/99_github/TinyWebServer$ sudo dpkg --configure -a