我在ubuntu服务器上的空间不足,所以我做了这个命令以节省空间
sudo rm -rf /var/cache/apt/archives
但是现在在尝试使用apt时,我会收到以下错误:
E: Could not open lock file /var/cache/apt/archives/lock - open (2 No such file or directory) E: Unable to lock the download directory
等等
Archive directory /var/cache/apt/archives/partial is missing.
显然我删除了一些目录结构.有没有办法做apt-get rebuild-var-tree或类似的?
你需要两件事:
sudo mkdir -p /var/cache/apt/archives/partial sudo touch /var/cache/apt/archives/lock sudo chmod 640 /var/cache/apt/archives/lock
一般来说,手动删除此目录是个坏主意.要干净地清理档案,请使用:
sudo apt-get clean