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

Re: Wannabe-maintainer's question

On Wed, Jul 26, 2000 at 04:03:42PM +0200, Andreas Rottmann wrote:
> Andreas Bombe <andreas.bombe@munich.netsurf.de> writes:
> > Provided the download machine also has apt-get, it is quite easy to do
> > with the right config files.  At the university a Debian mirror is just
> > one hop away, which gives nice download rates in the range of 4MB per
> > second which makes it quite worth it.
> > 
> > I take a whole directory from home to the university machine and back.
> > This contains the structure apt needs and two config files, one for
> > downloading and one for installing.
> > 
> > At home I copy the current dpkg status to this directory, tar it to DDS
> > tape and untar it at univ.
> >
> [snip]
> This seems really cool. Can you please give a little bit more
> information exactly what things are important (directory structure,
> connfiles)? I might as well find that out by myself, but since you
> seem to have it up and running, it would be a waste of time ;-)

First, a directory to contain all the files needed:

[apt-directory] _ apt.conf
               |_ aptinst.conf
               |_ sources.list
               |_ status
               |_ lists     _ [empty directory]
               \_ archives  _ pkgcache.bin
                           \_ srcpkgcache.bin

This is the initial layout, apt-get will add directories named "partial"
to lists and archives and files named lock when running in addition to
the expected downloaded package lists and debs.  The current
/var/lib/dpkg/status has to be copied to status everytime before you
take the whole directory to the download machine.

sources.list can be any list, but preferably the same as you have on
your home machine.  This has the advantage that you can use the
downloaded package lists by copying them to /var/state/apt/lists in case
you want to do some smaller package downloads at home.

Both pkgcache.bin and srcpkgcache.bin are expected to exist by apt-get,
you can simply create empty files with these names.

Now, to the conf files:

In my experience apt-get has problems with relative paths, it assumes
some paths to be absolute even when they do not start with '/' or start
with './'.  It also doesn't prepend paths given as group arguments to
relative paths in the group as you would expect.  Newer apt-gets may
have fixed that (haven't tried, to my shame I've never even made a
wishlist bug), but the machines at my university have slink and
therefore an old apt-get so this won't help me unless I compile my own.

This requires that I put the directories in fixed locations and that I
give absolute paths in the config files which make them look ugly.
Probably even more ugly than they have to be, I just meddled around
until they worked.  Adjust to your paths.


        Architecture "i386";
        Get::Download-Only "true";

Dir "/usr/stud/bombe/aeb-apt-dl"
        State "/usr/stud/bombe/aeb-apt-dl"
                status "status";

	Cache "/usr/stud/bombe/aeb-apt-dl"
                pkgcache "archives/pkgcache.bin";
                srcpkgcache "archives/srcpkgcache.bin";

	Etc "/usr/stud/bombe/aeb-apt-dl";


Dir "/usr/home/andreasb/tmp/aeb-apt-dl"
        State::lists "./lists";
        Cache::archives "/usr/home/andreasb/tmp/aeb-apt-dl/archives";
        Etc::sourcelist "./sources.list";

Now you will pass -c=apt.conf to apt-get for downloading, do the update
first, then dist-upgrade, then any install command you might want.  At
home pass -c=aptinst.conf (running as root then) and dist-upgrade and
then the same install command for extra debs you gave.  The only problem
is that you have to remember the install commands you gave when
downloading or you will have downloaded packages lying aroung that won't
get installed.  If everything went right, apt-get will ask you whether
it should download 0/XX MB of files, meaning 0 bytes left to download.
Say Y, and there you go.

After installation you can delete the debs from the archive directory,
copy new status and repeat procedure.

An advice I can give you is to avoid NFS mounted directories for
download, they make things slow (as in 100kB/s vs. 4MB/s).  The
/usr/stud/bombe/aeb-apt-dl I use is in fact a symlink to a directory in
a locally mounted tmp partition (whereas my home is NFS mounted).

Last advice: the slink apt-get with the ftp method seems to set dates on
downloaded files strangely (or that happens in conjunction with
ftp.leo.org or whatever), some get dates in the year 1910.  tar will
then ignore these files, and you may find yourself at home with missing
archives which is very annoying.  Solution: "find . -exec touch {} \;"
if you see files with strange dates.

Both of these advices can be ignored if you download directly to a
removable medium like Zip disks.

 Andreas E. Bombe <andreas.bombe@munich.netsurf.de>    DSA key 0x04880A44
http://home.pages.de/~andreas.bombe/    http://linux1394.sourceforge.net/

Reply to: