在Ubuntu中,有时候运用sudo apt-get install 安装软件时,会出现一下的情况
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?
在这个时候,主要是因为apt还在运行,
1.ps -A | grep apt 获取进程
2.sudo kill -SIGKILL 进程ID 杀死进程
3. sudo rm /var/lib/dpkg/lock
4. sudo dpkg --configure -a
5. sudo rm /var/lib/apt/lists/lock
6.sudo rm /var/cache/apt/archives/lock
7.删除这些锁定文件
8.sudo apt update
9.sudo apt-get install git-core