运行“sudo apt-get autoclean”时出错

运行“sudo apt-get autoclean”时出错

当我运行命令时,sudo apt-get autoclean收到如下错误消息:

$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to read /var/cache/apt/archives/partial/ - opendir (2: No such file or directory)

这是什么错误?我该如何解决?

答案1

当你更新系统时,软件包将存储在其中/var/cache/apt/archives;当下载未完成时,部分下载的 .deb 文件将移动到/var/cache/apt/archives/partial

尝试重新创建目录(通常应该是空的),如下所示:

sudo mkdir /var/cache/apt/archives/partial

然后,重新运行该命令。

答案2

错误 E: Unable to read /var/cache/apt/archives/partial/ - opendir (2: No such file or directory)清楚地表明“没有这样的文件或目录”。

因此,尝试创建目录,只需按下键盘上的Ctrl+ Alt+T即可打开终端。打开后,运行以下命令:

sudo mkdir -p /var/cache/apt/archives/partial

答案3

检查目录是否存在。

 ls /var/cache/apt/

如果存档文件夹不存在,请运行

sudo mkdir -p /var/cache/apt/archives/partial/
sudo apt-get autoclean

相关内容