一:
在用sudo apt-get install 安装软件时,由于速度太慢,想换个软件源,直接关闭了终端,apt-get但进程没有结束,结果终端提示
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?
E: 无法获得锁 /var/lib/dpkg/lock – open (11: 资源暂时不可用) E: 无法锁定管理目录(/var/lib/dpkg/),是否有其他进程正占用它?
解决办法如下:
1 终端输入 ps -aux | grep apt,列出进程。找到含有apt的进程,直接sudo kill PID。解决。
2 强制解锁,命令
sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock
二:
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: 资源暂时不可用
Setting up shim-signed (1.19~16.04.1+0.8-0ubuntu2) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing package shim-signed (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: shim-signed
解决方法:
$ sudo lsof /var/cache/debconf/config.dat lsof: WARNING: can‘t stat() fuse.gvfs-fuse-daemon file system /home/amw/.gvfs Output information may be incomplete. COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME frontend 3350 root 4uW REG 7,0 40347 2966 /var/cache/debconf/config.dat
$ sudo kill 4250
$ sudo apt-get autoclean
$ sudo apt-get clean
$ sudo apt-get autoremove
$ sudo apt-get update
然后可以试着用apt-get安装软件。
时间: 2024-10-07 22:01:58