如何解锁 /var/cache/apt/archives/lock

如何解锁 /var/cache/apt/archives/lock

我尝试从 deb 安装 Firefox,而不是从 Firefox snap 安装,因为 Firefox 扩展在 snap 版本中不起作用,但系统尝试重新安装 snap 版本。要求批准重新安装 snap 版本的对话框关闭了,没有给出任何答复,现在 apt 已被锁定,无法解锁。

Could not get lock /var/cache/apt/archives/lock. It is held by process 33889 (apt)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to lock directory /var/cache/apt/archives/

我尝试过终止进程 33889,但它就是死不了!/var/cache/apt/archives/ 中的锁定文件似乎有 0 个字节。

答案1

2种方法:

sudo killall apt-get

或者 ...

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

相关内容