PDA

View Full Version : [ubuntu] Local Network Repository Mirror - With a Catch



ryannathans
January 19th, 2012, 08:34 AM
Not sure what to search for as all previous searches don't help much.

Basically I have 5 ubuntu machines on my local network. When there is an update, I must download the update manually and seperately on each one.

Is there a way that I can have these 5 machines download the packages from my server.

I don't want to download the whole repository and host that locally.

When I need a package the clients should ask my server for it, if the server doesn't have it - it should be fetched from the internet and then cached ON THE SERVER for use on the remaining 4 machines.

I can't work out the best way to do this, nor can I find a similar/realistic alturnative.

Anyone got any ideas?

-Much Appreciated
ryannathans

ryannathans
January 20th, 2012, 03:20 PM
bumpity

cortman
January 20th, 2012, 04:08 PM
Hm... Very interesting question!

My guess is you'd need to write a small script that would run apt-get upgrade -d >> upgrades.list. The cp the list to the server and have a script on the server add wget commands to the package script.
I think it could be done but it'd take a little bash wizardry.

maminyana
February 20th, 2012, 11:14 AM
I don't want to download the whole repository and host that locally.




You could:
1- download updates in one machine,
2- Copy the whole dir: /etc/cache/apt/archives/* to the other machines.
3- run "apt-get update"

In order to do this, just share /etc/cache/apt/archives/ via NFS or samba, and write a simple script.


Another alternative is to use aptOnCD.

Cheesehead
February 20th, 2012, 02:39 PM
The apt-cacher-ng package is designed for this use case.

ryannathans
February 20th, 2012, 03:45 PM
The apt-cacher-ng package is designed for this use case.

I ended up with the apt-cacher.

First request Fri Jan 20 23:55:06 2012
Last request Sun Feb 19 11:14:15 2012
Total requests 6203
Total traffic 3.17 GB
Transfers 1826.505 MB (56.25%) (Cache hit) 1420.164 MB (43.74%) (Cache Miss)