问题
使用apt-get install时,提示:
E: 无法获得锁 /var/lib/dpkg/lock - open (11: 资源暂时不可用)
E: 无法锁定管理目录(/var/lib/dpkg/),是否有其他进程正占用它?
解决方案
方案一:列出进程,找到含有apt-get的进程,直接sudo kill PID解决(测试,无效)
1 ps -aux | grep apt-get 2 sudo kill PID
方案二:强制解锁(测试,有效)
1 sudo rm /var/cache/apt/archives/lock 2 sudo rm /var/lib/dpkg/lock