apt被锁住

今天想用apt装一个软件结果遇到这个问题
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
在StackFlow上有一个帖子专门讨论solution
因为服务器上有别人的代码在跑,所以先没考虑重启的做法
用了
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

ps aux | grep apt
kill processnumber
两个方法,都不行

最后还是决定重启,又遇到这么个问题,
输入sudo reboot
Failed to start reboot.target: Connection timed out See system logs and ‘systemctl status reboot.target’ for details.
查看了这个帖子
使用这个指令就行了
sudo systemctl --force --force reboot

猜你喜欢

转载自blog.csdn.net/u012397583/article/details/84192004
apt