Score:0

For apt to use local cache - apt-cacher-ng

ru flag

I have a host where I have installed apt-cacher-ng and copied over a pre-populated cache under /var/cache/apt-cacher-ng. I see that the service is running with no errors. However, when I try to download something, apt still seems to try and use archive.ubuntu.com ! This host does not have network connectivity. How can I make sure to tell apt to use only the local cache ?

I have also added the following config:

$ cat /etc/apt/apt.conf.d/99_local_proxy.conf
Acquire::http::Proxy "http://localhost:3142/";
Acquire::ForceIPv4 "true";
Acquire::Retries "3";

This is the error I get:

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]
Score:1
cn flag

Sorry, I misunderstood.

What you want is a personal repository with no traffic to the internet. Even better, it's already been done, documented, and it's up on the Ubuntu wiki.

Ubuntu Wiki - Personal Repository

Part of the directions for a personal repository is changing the sources.list to a file path. If there are no network URLs (http/https/ftp) then apt will not go on the network. It will only look in the locations listed in the sources.list file.

ru flag
ok, so this is like PPA, but we can add any packages we want! Also, I assume that this can host more than one release - like trusty + bionic packages.
cn flag
If you manually add/update packages, make sure you regenerate the meta.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.