2

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?

  • Did you try preseeding a specific mirror (probably one which is known to work well)? – muru Nov 03 '14 at 21:29
  • Yes, for awhile I was setting the mirror to be only an aws ec2-west official ubuntu mirror that was supposedly a "good" one for working in the US, but this mirror seems to go down for maintenance quite often and this continued to be a problem. If there is another one that has better uptime I can just hardcode I'd love to try that as a temporary workaround. – user1391445 Nov 03 '14 at 21:31
  • You could also try setting up a VM as a local mirror. It would take about 100GB, and the VM should have reasonably good availability and transfer speeds should be high too (I guess). – muru Nov 03 '14 at 21:34
  • I'm assuming that would take some work to do and keep current, as well as have it play nice with building up VMs remotely in cloud services, but could be a reasonable solution. Can you suggest any guides on how to set this up? – user1391445 Nov 03 '14 at 21:38
  • 1
    Setting up a local mirror with 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 covers apt-cacher-ng, a caching proxy that might mre suited to your needs). – muru Nov 03 '14 at 21:48

0 Answers0