1. 杀死之前的相关进程
ps -e|grep apt-get
显示
6965 ? 00:00:01 apt-get
然后执行
sudo kill 6965
2. 强制解锁
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
ps -e|grep apt-get
显示
6965 ? 00:00:01 apt-get
然后执行
sudo kill 6965
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock