[PLUG] apt-proxy (Re: Debian Q: Can you upgrade a system from the /var/cache/apt of another?)

Karl M. Hegbloom karlheg at hegbloom.net
Fri Aug 16 05:39:32 UTC 2002


Jason Dagit <dagit at engr.orst.edu> writes:

> This question is probably more for Karl than anyone else, but lets
> see...
> 
> On my computer I haven't cleaned apt's cache in a very long time,
> 1.4GB worth of .deb's in fact.  I have only a puny dial up
> connection and I recently borrowed a friend's broadband to update my
> installation.  Now I want to upgrade my roommates computer.
> Essentially I want to use the /var/cache/apt from my computer to
> upgrade his computer.

You probably should run "apt-get autoclean" now and then, to purge old
ones that are no longer listed in the Packages and Sources metadata
files.

> Is there an easy way to do this?  Could I somehow set my computer to
> act like a debian mirror to his computer?  We have a 100Mbps network
> here in the aptartment...

Mise en place:

# apt-get install apt-proxy

... on the first machine.  After you RTFM...

Edit the "/etc/apt-proxy/apt-proxy.conf", and add something like:

8<------------------------------------------------------------>8
add_backend /main/					\
	$APT_PROXY_CACHE/debian/			\
	http://ftp.us.debian.org/debian/

add_backend /non-US/					\
	$APT_PROXY_CACHE/non-US/			\
	http://non-us.debian.org/

add_backend /security/					\
	$APT_PROXY_CACHE/security/			\
	security.debian.org::debian-security/		\
	non-us.debian.org::debian-security/		

add_backend /openoffice/ \
	$APT_PROXY_CACHE/openoffice/ \
	http://www.phy.olemiss.edu/openoffice/
8<------------------------------------------------------------>8

You might like to adjust other things in there, of course.

Then, run, as root, "apt-proxy-import /var/cache/apt/archives".

On the other machine, you use URL's like this in
"/etc/apt/sources.list":

8<------------------------------------------------------------>8
deb     http://apt.intra.hegbloom.net:9999/main/ stable main contrib non-free
deb-src http://apt.intra.hegbloom.net:9999/main/ stable main contrib non-free

deb     http://apt.intra.hegbloom.net:9999/non-US/ stable/non-US main contrib non-free
deb-src http://apt.intra.hegbloom.net:9999/non-US/ stable/non-US main contrib non-free

deb     http://apt.intra.hegbloom.net:9999/security/ stable/updates main contrib non-free
deb-src http://apt.intra.hegbloom.net:9999/security/ stable/updates main contrib non-free

deb     http://apt.intra.hegbloom.net:9999/openoffice/ testing main contrib
deb-src http://apt.intra.hegbloom.net:9999/openoffice/ testing main contrib
deb     http://apt.intra.hegbloom.net:9999/openoffice/ unstable main contrib
deb-src http://apt.intra.hegbloom.net:9999/openoffice/ unstable main contrib
8<------------------------------------------------------------>8

And that will cause the other machine to pull through the apt-proxy.
It will only go to the Internet for packages not already in it's cache.

I've been using this for a couple of weeks now, and am finding that it
works very well.  You can perform installs using it also.  During the
install, after the reboot when you are setting up Apt, where it asks
for the hostname, give something like "apt.intra.hegbloom.net:9999" as
the hostname, then when it asks for the directory on the server, tell
it "/main/".  I've been selecting "edit sources.list by hand" and
typing them in, including the "security" one through the proxy, then
saying "no" when it asks about whether to use security.  Also say no
to useing non-us, and add that by hand too, as shown above.

-- 
As any limb well and duly exercised, grows stronger,
the nerves of the body are corroborated thereby. --I. Watts.  .''`.
 Debian -- The blue collar Linux distribution.               : :' :
 <URL:http://www.debian.org/social_contract>		     `. `'




More information about the PLUG mailing list