Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to have apt-cacher server for both Ubuntu version 10.04 & 10.10 in one machine? IF yes can someone explain pls.

The first CD cache of Ubuntu 10.10 works fine.

I have imported the second cd cache of Ubuntu version 10.04, and now when i update Ubuntu 10.04 client, I get the following error..

root@TME51:/etc/apt# apt-get update
Err http://172.29.32.9 lucid Release.gpg
  Could not connect to 172.29.32.9:3142 (172.29.32.9). - connect (111: Connection refused)
Err http://172.29.32.9/ubuntu/ lucid/main Translation-en_IN
  Unable to connect to 172.29.32.9:3142:
Err http://172.29.32.9/ubuntu/ lucid/restricted Translation-en_IN
  Unable to connect to 172.29.32.9:3142:
Err http://172.29.32.9/ubuntu/ lucid/universe Translation-en_IN
  Unable to connect to 172.29.32.9:3142:
Err http://172.29.32.9/ubuntu/ lucid/multiverse Translation-en_IN
  Unable to connect to 172.29.32.9:3142:
Reading package lists... Done
W: Failed to fetch http://172.29.32.9:142/ubuntu/dists/lucid/Release.gpg  Could not connect to 172.29.32.9:3142 (172.29.32.9). - connect (111: Connection refused)

W: Failed to fetch http://172.29.32.9:142/ubuntu/dists/lucid/main/i18n/Translation-en_IN.bz2  Unable to connect to 172.29.32.9:3142:

W: Failed to fetch http://172.29.32.9:142/ubuntu/dists/lucid/restricted/i18n/Translation-en_IN.bz2  Unable to connect to 172.29.32.9:3142:

W: Failed to fetch http://172.29.32.9:142/ubuntu/dists/lucid/universe/i18n/Translation-en_IN.bz2  Unable to connect to 172.29.32.9:3142:

W: Failed to fetch http://172.29.32.9:142/ubuntu/dists/lucid/multiverse/i18n/Translation-en_IN.bz2  Unable to connect to 172.29.32.9:3142:

W: Some index files failed to download, they have been ignored, or old ones used instead.
share|improve this question
    
A rather inelegant solution would simply be to run the second OS in VirtualBox on the server you want to cache everything, and install apt-cacher or whatever on it. –  zpletan Oct 25 '11 at 11:59
add comment

3 Answers 3

up vote 6 down vote accepted
+250

apt-cacher

When running multiple machine with the same distribution, it is interesting to set up a repository cache on your network so that once a package is downloaded from an official repository, all other machines will download it from your local area network.

Having different machines running the same linux distribution, it becomes interesting to set up a repository cache somewhere on your network. This way, you won't download common packages more than 1 time from official repositories.

Here is the situation, we have one machine called repository-cache, this machine is going to act as the repository cache, basically, any other machines in your network is going to use it as a repository.

1. How To Set up a repository cache with apt-cacher

How To Set up a repository cache with apt-cacher

2. Conclusion

apt-cacher is an easy and efficient package which will save you both time and bandwidth when using multiple machines with the same distribution like it could happen in a home network or in at a company.


apt-mirror

It is a perl-based utility for downloading and mirroring the entire contents of a public repository. This may likely include packages that you don't use and will not use, but anything stored in a public repository will also be stored in your mirror.

1. How To Set up a repository cache with apt-cacher

To configure apt-mirror you will need the following:

apt-mirror package `sudo apt-get install apt-mirror`
apache2 package  `sudo apt-get install apache2`
**roughly 15G of storage per release, per architecture**

How to Set up a repository with apt-mirror

2. Conclusion

I find this difficult but very effective in saving bandwidth but on the other side the results is a high consumption of disk space.


apt-cacher-ng

is a caching proxy for downloading packages from Debian-style software repositories (or possibly from other types).

The main principle is that a central machine hosts the proxy for a local network, and clients configure their APT setup to download through it. Apt-Cacher NG keeps a copy of all useful data that passes through it, and when a similar request is made, the cached copy of the data is delivered without being re-downloaded.

Apt-Cacher NG has been designed from scratch as a replacement for apt-cacher, but with a focus on maximizing throughput with low system resource requirements. It can also be used as replacement for apt-proxy and approx with no need to modify clients' sources.list files.

2. Conclusion

is a caching proxy specialized for package files from GNU/Linux distributors, primarily for Debian and Debian based distributions (like Ubuntu). This means that if you have many Debian/Ubuntu machines on your network, you just have to download the deb packages (new software, updates, distro upgrades, etc) from the internet once and the rest of the Debian/Ubuntu machines get them from Apt-Cacher NG cache, saving time and internet bandwidth.

Next time any of your machines needs a deb package, it will ask Apt-Cacher NG for it. If this package was asked previously by any of the other machines, Apt-Cacher will have a copy and will deliver it. Otherwise, it will fetch it from the internet repositories, keep a local copy and deliver it.

Best way to cache apt downloads on a LAN? see Piskvor's answer

Let do it some markeying in Full Circle Issue #54 there is an interesting article about Part 2, Apt-Cache NG

share|improve this answer
add comment

Using apt-cacher-ng could be an alternative. You can find the manual here.

share|improve this answer
    
I am running apt-cacher-ng with multiple Ubuntu versions using it (including the test virtual machines I use for new versions). No configuration required on the server to support multiple versions and no problems. –  Joe P Oct 25 '11 at 19:29
add comment

Apt-Cacher is a caching proxy. This means it just caches every downloaded package, whether it will be used by Ubuntu 10.04, 10.10 or whatever. There is no need for a special configuration on the server, it just works!

The only thing you have to do is to redirect your clients /etc/apt/sources.list to use it.

Example-line Server A with lucid:

http://your-apt-cacher-server/apt-cacher/archive.ubuntu.com/ubuntu/ lucid main restricted

Example Server B with natty

http://your-apt-cacher-server/apt-cacher/archive.ubuntu.com/ubuntu/ natty main restricted

Further info: https://help.ubuntu.com/community/Apt-Cacher-Server

Another alternative for apt-cacher: https://help.ubuntu.com/community/AptProxy

share|improve this answer
    
Yeah that is fine. But how to import CD cache? –  karthick87 Oct 28 '11 at 16:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.