Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
17
rated 0 times [  17] [ 0]  / answers: 1 / hits: 88422  / 1 Year ago, tue, may 16, 2023, 4:29:49

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




  1. apt-cacher-ng as mentioned in the answers.

  2. Docker images built for caching apt files (they run squid actually)

  3. Simply using squid



Also, as mentioned in the answers, see Best way to cache apt downloads on a LAN?


More From » apt

 Answers
0

Not an explicit answer to your question, but have you considered setting up an apt proxy? I use apt-cacher-ng (apt-get install apt-cacher-ng). Prehaps set this up on the VM host, and tell the VMs (and the host) to use this as their proxy (as simple as adding a file (eg 02proxy) to /etc/apt/apt.conf.d/
containing


Acquire::http { Proxy "http://vm host ip:3142"; };

That way you can just do apt-get upgrade without having to manually copy file around. When one computer downloads the debs they will be stored on the proxy for the next computer that requests it. Can handle multiple releases and different architectures, etc


[#39634] Wednesday, May 17, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rieency

Total Points: 299
Total Questions: 116
Total Answers: 111

Location: Wales
Member since Tue, Dec 14, 2021
2 Years ago
;