There are multiple virtual machines running Ubuntu and they are all updated by the following command:
apt-get update
apt-get upgrade
But updating each VM separately takes a lot of time to download the required packages and also uses massive amount of bandwidth (which I'm running out of). Is it possible to transfer the updated files by apt-get
directly into VMs?
I know the packages are stored in /var/cache/apt/archives
but I need the apt-get database files (list of mirrors, indexes, available packages on mirrors, ...)
Update: There are many solutions
- apt-cacher-ng as mentioned in the answers.
- Docker images built for caching apt files (they run squid actually)
- Simply using squid
Also, as mentioned in the answers, see Best way to cache apt downloads on a LAN?
apt-config dump
to print the config to the screen. The entry you want isDir::Cache
. The values build up on their parent entries. So you need to look atDir
to get context for the value ofDir::Cache
. On my system its/var/cache/apt/
. It's also possible to query individual entries. I didnt look into how to do that though.