I’ve been playing quite a lot lately with Juju and other related software projects, like conjure-up and LXD. They make so easy to spin up and down complex software stacks like OpenStack that you don’t even realize until your hosting provider start alerting you of high traffic consumption. And guess where most of this traffic usage comes from? From installing packages.
So I decided to save on bandwidth by using apt-cacher. It is straightforward and easy to set up and getting it running. In the end, if you follow the steps described in the previous link or this, you will end up with a Perl program listening on your machine in port 3142 that you can use as an Apt cache.
For Juju, one can use a YAML configuration file like this:
apt-http-proxy: http://localhost:3142 apt-https-proxy: http://localhost:3142
Then bootstrap Juju using the following command:
$ juju bootstrap --config config.yaml localhost lxd
conjure-up is also very easy:
$ conjure-up \ --apt-proxy http://localhost:3142 \ --apt-https-proxy http://localhost:3142 \ ...