How to setup an apt-cacher in ubuntu 11.04?
Following is the scenario which we had to come up with an apt-cacher set up.
There are several machines Ubutnu 11.04 installed and each time one user needs a software installed he runs
sudo apt-get instal command and this is done by each user in each machine which would eats up the bandwidth.
Instead of that caching the installed software can have a dramatic impact on the use of bandwidth.Apt-cacher is a tool
which would act as middle man between the public repository and the LAN clients, sharing any common downloads internally.
i.e. whenever a user requests for a new installation or an update for the first time, the tool would download them from the public repository and store it and pass it back to that user. The package is then made available to any future requests from the internal network.When another user requests for the same installation instead of going to the public repository again it woul pass from what is already installed.
Setting up the apt-cacher is quite simple and is described below.
First we need apt-cacher and some tools installed.
Do a sudo aptitude install apt-cacher
sudo aptitude install apache2
To activate the service edit /etc/default/apt-cacher file and change the AUTOSTART value to "1".
You can also limit access to the cache within the /etc/apt-cacher/apt-cacher.conf file. Update the value for allowed_hosts to match the individual hosts or subnets that you want to allow.
To start the caching system type in cmdline, sudo /etc/init.d/apt-cacher restart.
Now you have the apt-cacher up and running.The final step is to set up the client.
Following is the scenario which we had to come up with an apt-cacher set up.
There are several machines Ubutnu 11.04 installed and each time one user needs a software installed he runs
sudo apt-get instal command and this is done by each user in each machine which would eats up the bandwidth.
Instead of that caching the installed software can have a dramatic impact on the use of bandwidth.Apt-cacher is a tool
which would act as middle man between the public repository and the LAN clients, sharing any common downloads internally.
i.e. whenever a user requests for a new installation or an update for the first time, the tool would download them from the public repository and store it and pass it back to that user. The package is then made available to any future requests from the internal network.When another user requests for the same installation instead of going to the public repository again it woul pass from what is already installed.
Setting up the apt-cacher is quite simple and is described below.
First we need apt-cacher and some tools installed.
Do a sudo aptitude install apt-cacher
sudo aptitude install apache2
To activate the service edit /etc/default/apt-cacher file and change the AUTOSTART value to "1".
You can also limit access to the cache within the /etc/apt-cacher/apt-cacher.conf file. Update the value for allowed_hosts to match the individual hosts or subnets that you want to allow.
To start the caching system type in cmdline, sudo /etc/init.d/apt-cacher restart.
Now you have the apt-cacher up and running.The final step is to set up the client.
Add a proxy setting to the /etc/apt/apt.conf.d/ directory. To do this is create a new file called 90-apt-proxy.conf and entering the line. Following would open up the file in gedit.
sudo gedit /etc/apt/apt.conf.d/90-apt-proxy.conf
Enter the following line to that file.
Acquire::http::Proxy "http://cache-ip:3142";
Replace "cache-ip " with the IP address or URL of the machine you installed apt-cacher in.
There is no limit of the no of machines you can point to the apt-cacher.
Before ending the post I must say thank you to this web post. It was very hard to find the exact information while we were working on this and hope this post would help those are in the same scenario.
Have a great day!: )