我在一个主机上安装了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]发布于 2021-10-03 17:09:55
对不起,我误会了。
你想要的是一个没有互联网流量的个人存储库。更好的是,它已经完成,记录在案,并且已经在Ubuntu上运行。
个人存储库的部分说明是将sources.list更改为文件路径。如果没有网络URL (http/https/ftp),那么apt就不会在网络上运行。它将只查看sources.list文件中列出的位置。
https://askubuntu.com/questions/1366686
复制相似问题