I'm doing a lot of deploying and tearing down of VMs locally and on several cloud services (on the order of two or three a day) and my biggest problem with this is that apt-get install often fails with a 503 error, or it chooses a mirror that is very slow and downloads will fail or exceed a ten minute timeout. This happens at least once a week, sometimes every day. This is on a highly reliable, fast network locally as well as on cloud services like google cloud, aws, etc.
Right now all I'm running is
apt-get update
apt-get install xyz
For various common packages like mongo, java, nodejs, git, etc.
How can I make apt-get more robust in startup scripts that build these VMs?
apt-mirror
is not difficult: https://raymii.org/s/tutorials/Set_up_a_local_Ubuntu_debian_apt_mirror.html. Also see: http://askubuntu.com/q/319433/158442 and http://askubuntu.com/q/46534/158442 (which coversapt-cacher-ng
, a caching proxy that might mre suited to your needs). – muru Nov 03 '14 at 21:48