修复 apt 安装

修复 apt 安装

我尝试使用 apt install 安装某些东西,但由于磁盘空间不足而失败。我释放了磁盘空间,但现在无法安装任何东西。

sudo apt install emacs

给出

W: Not using locking for read only lock file /var/lib/dpkg/lock-frontend
W: Not using locking for read only lock file /var/lib/dpkg/lock
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

我试过

sudo dpkg --configure -a

这使

dpkg: error: unable to access the dpkg database directory /var/lib/dpkg: Read-only file system

阅读dpkg:错误:无法访问 dpkg 状态区域:只读文件系统我试过

rm -f /var/lib/dpkg/lock

这使

rm: cannot remove '/var/lib/dpkg/lock': Read-only file system

chmod -r +w /var/lib/dpkg/lock

给出

chmod: cannot access '+w': No such file or directory
chmod: changing permissions of '/var/lib/dpkg/lock': Read-only file system

我在跑步

NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"

在 WSL2 上。

相关内容