我有一个主机,我在其中安装并复制apt-cacher-ng
了. 我看到该服务正在运行,没有错误。但是,当我尝试下载一些东西时,似乎仍然在尝试使用!此主机没有网络连接。我怎样才能确保告诉只使用本地缓存?/var/cache/apt-cacher-ng
apt
archive.ubuntu.com
apt
我还添加了以下配置:
$ cat /etc/apt/apt.conf.d/99_local_proxy.conf
Acquire::http::Proxy "http://localhost:3142/";
Acquire::ForceIPv4 "true";
Acquire::Retries "3";
这是我得到的错误:
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/bionic/InRelease 503 DNS error for hostname us.archive.ubuntu.com: Temporary failure in name resolution. If us.archive.ubuntu.com refers to a configured cache repository, please check the corresponding configuration file. [IP: 127.0.0.1 3142]
对不起,我误会了。
您想要的是一个没有互联网流量的个人存储库。更好的是,它已经完成、记录在案,并且在 Ubuntu wiki 上。
Ubuntu Wiki - 个人存储库
个人存储库的部分说明是将sources.list 更改为文件路径。如果没有网络 URL (http/https/ftp),则 apt 将不会进入网络。它只会查看 sources.list 文件中列出的位置。