[ubuntu-za] add repo
Charl Wentzel
charl.wentzel at vodamail.co.za
Fri Feb 17 07:42:55 UTC 2012
-----Original Message-----
From: Miles <msdomdonner at gmail.com>
> Yes please, I would appreciate detailed instructions as I
> battle a bit with very technical stuff.
It's quite easy, I can do it in my sleep by now. I use apt-cacher-ng
all the time, especially on sites where I have multiple Ubuntu
machines/servers installed. Some customers don't want to give my
machines internet access but the are willing to setup an apt-cacher-ng
server for me.
Follow these steps. I'm referring to a server and a client. The
server is the machine running apt-cacher-ng and the client is any
machine that uses the apt-cacher-ng server for updates. Of course it
can be the same machine as well.
A. On the apt-cacher-ng server
1. Install apt-cacher-ng:
sudo aptitude install apt-cacher-ng
B. On each of your client machines (including the server)
2. Create the apt-cacher-ng proxy reference file:
sudo nano /etc/apt/apt.conf.d/01apt-cacher-ng-proxy
Copy the following line into the file:
Acquire::http { Proxy "http://[server ip address]:3142"; };
You obviously have to replace [server ip address] with the ip address
of your apt-cacher-ng server.
3. Run an update (very important, must be done at least once)
sudo aptitude update
C. On the apt-cacher server
4. Copy the existing archives
First create the import directory:
sudo mkdir /var/cache/apt-cacher-ng/_import/
Now copy the archives:
sudo cp /var/cache/apt/archives/* /var/cache/apt-cacher-ng/_import/
You can also use sftp or scp to copy archives from other machines to
this directory. You could also use another directory like an external
hard drive. Just change the apt-cacher-ng cache directory in its
config file: /etc/apt-cacher-ng/acng.conf
5. Perform an import
Type the following address in your web browser:
http://[server ip address]:3142
Goto the configuration page. At the bottom you'll find the "import"
button. This may take quite some time, so go make yourself a slow cup
of tee.
6. Delete imported files (optional)
If you want to save space you can delete the contents of the import
directory:
sudo rm /var/cache/apt-cacher-ng/_import/*
7. Switch to off line mode:
You can turn off-line mode on in the config file:
/etc/apt-cacher-ng/acng.conf
by uncommenting the following line: (remove the "#")
# offlinemode:0
You can switch between on and off line modes as often as you like. And
there are plenty more settings you can read up about.
B. On each of your client machines (including the server)
Now you can perform updates and installs as you normally would, even
without an internet connection:
sudo aptitude update
Note however, that if you are in off-line mode you only have access to
the packages already downloaded or imported into apt-cacher-ng.
If you want one of your clients to stop using the apt-cacher-ng server,
simply comment out the contents of the file:
/etc/apt/apt.conf.d/01apt-cacher-ng-proxy
on that machine.
Also note that it would not be a good idea to run apt-cacher-ng in
online mode once the repositories for Maverick has been shut down. It
would download/update anything. Switch to offline mode before this
happens.
> As a matter of interest look at
> apt-move. Looks promising but I cant figure out the correct commands to use.
> as in this line Usage: apt-move [-c conffile] [-d dist] [-afqt] COMMAND
> Gonna take me forever to actually understand these things.
I have never heard of it, but will take a look.
> Its the bandwidth thats my main problem here.
That is exactly what apt-cacher-ng is helping with, but only if you
have multiple machines doing the same updates.
Hope this helps.
Have fun!
More information about the ubuntu-za
mailing list