apt - 如何禁用内容文件的获取?

Ant*_*yva 5 linux shell ubuntu debian apt

apt update我想避免下载所有的contents.gz文件以节省时间和网络资源时。如何使用命令行选项或配置文件来完成此操作?

Ste*_*itt 8

aptContents默认不\xe2\x80\x99下载文件;如果它\xe2\x80\x99s在你的系统上这样做,它\xe2\x80\x99s可能是因为你apt-file也安装了。在这种情况下,要禁用Contents下载,请禁用相应的配置文件:

\n
sudo mv /etc/apt/apt.conf.d/50apt-file.conf{,.disabled}\n
Run Code Online (Sandbox Code Playgroud)\n

这将导致apt update跳过Contents文件。结果,apt-file将无法工作,或者充其量只能使用过时的信息;为了能够使用它并更新其索引,请重新启用配置文件:

\n
sudo mv /etc/apt/apt.conf.d/50apt-file.conf{.disabled,}\n
Run Code Online (Sandbox Code Playgroud)\n

然后再次运行apt update

\n