[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

APT -- if I do this will I screw the pooch?



Got a question relating to APT. I typically use aptitude in command-line mode as a front-end to APT. I'm running Sarge kept up to date with security updates, on a single-processor Pentium 4-based desktop machine. My kernel is a self-built 2.6.15.4 built with make-kpkg from kernel.org source.

I'm planning shortly to add a second Debian machine, a notebook, to my home network. I intend to keep the versions of Debian on the two machines, my current desktop and the new notebook, basically in step but don't want to be forced to ie if considering a major upgrade, want to be able to do one first, play around with it, then do the other.

I don't have up to date install CDs and don't want to download them, so I was thinking of setting up the notebook by doing a basic install off my old woody CDs I originally set up my desktop off of, getting a working net connection in place, then immediately upgrading everything via the net to current stable before building out the system any further. Since I've already gone through the upgrade process, over the last 2 years, with my desktop machine I have all the packages downloaded in my /var/cache/apt/archives directory. I don't want the notebook to have to download them all again, especially since security.debian.org, which has a lot of the latest versions of stable packages, seems to get overloaded and be very slow to download at times.

After reading the man pages on apt, apt.conf, aptitude etc, and googling around, here's what I am thinking of doing. First of all, exposing my desktop's /var/cache/apt/archives as an NFS mount, configuring my gateway's firewall to prevent anyone mounting it from outside my LAN. Mounting this NFS mount on the laptop, let's say at /mnt/aptarchive. Then, setting APT config option Dir::Cache::archives on the notebook to point at /mnt/aptarchive, *without touching the other Dir::Cache options*. This is because although I want them both to use the same repository of downloaded package files, I want the two machines to independently track what's installed, so I don't have to keep installed packages identical on both machines.

Here's what *I think* the effect of this will be:

1. The notebook, when asked to dist-upgrade and later to install packages I didn't install from the woody CDs, will not have to download the package from outside my network because its archive already contains the package (always assuming that the package concerned is installed on the desktop, which 90% of what I want to install on the notebook will be). 2. The notebook and the desktop will have independent views of what's installed, and will each know nothing about what's installed on the other machine (which is fine). 3. If I want to install something on the notebook that's not installed on the desktop, the notebook will download it as normal and put it in the same archives location. 4. This means that if I then later decide to install that package on the desktop, it will find it already has the package and not download it (assuming a newer one hasn't become available in the meantime). 5. Installing a package on one machine will have no effect whatever on the other machine's notion of whether or not that package is installed.

Reading the APT documentation, it seems to encourage using squid to set up a local caching download proxy to achieve this goal, setting APT to use the proxy when downloading packages. I don't like this approach as it would mean having at least 2 copies of the downloaded packages (on the desktop and on the notebook, if I can persuade squid to use the desktop's /var/cache/apt/archives dir as its cache dir) or maybe even 3 (squid's repository, the desktop's /var/cache/apt/archives, and the notebook's /var/cache/apt/archives if I can't get squid and the desktop's APT to play nice). Since the point is to avoid extra downloads and also space wastage, I'd rather go with my approach.

What I'm looking for is input from more experienced hands with APT on whether I will screw anything if I do what I'm proposing, sharing the archives dir between 2 machines without sharing the package cache and source cache files. The documentation is somewhat ambiguous on whether or not what I'm proposing is possible.

I *could* just try it, but I don't want to utterly screw my desktop if I can avoid it...

Mark



Reply to: