我无法使用“apt update”命令

我无法使用“apt update”命令

每当我使用该命令时,sudo apt update我都会得到以下信息:

W: Not using locking for read only lock file /var/lib/dpkg/lock
W: chown to _apt:root of directory /var/cache/apt/archives/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
W: chmod 0700 of directory /var/cache/apt/archives/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
W: Not using locking for read only lock file /var/cache/apt/archives/lock
E: Could not create temporary file for /var/lib/apt/extended_states - mkstemp (30: Read-only file system)
E: Failed to write temporary StateFile /var/lib/apt/extended_states
W: Could not open file '/var/log/apt/term.log' - OpenLog (30: Read-only file system)
E: Sub-process /usr/bin/dpkg returned an error code (2)
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - pkgDPkgPM::Go (30: Read-only file system)

有人能帮我解决这个问题吗?

答案1

尝试删除/var/lib/dpkg/lock文件并重试。

我之前安装失败时也遇到过类似的问题。有时该文件处于锁定状态。

相关内容