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

Re: Offline APT



On Mon, Sep 03, 2001 at 10:00:24AM +0100, Ross Burton wrote:
> I got this reply off-list:
> 
> On Sat, 2001-09-01 at 12:40, Thomas Bleicher wrote:
> > I do:
> > 
> > apt-get -qq --print-uris [upgrade | install <something>] > urls
> > 
> > and then run my script on the file urls.

Now it has a name to ;)

  $ ziplist.py urls

I added a bit interactivity this afternoon; you can now decide to create
the shell-scripts during the run -- or to put some huge packages on hold
before (dselect or dpkg). It's not very good tested, sorry.
 
> > When I come back with the filled zips, i just copy all the downloaded
> > files to /var/cache/apt/archives/. Then I can run "apt-get upgrade" and
> > when the archive is scanned, all packages are found and installed,
> > provided all have been downloaded successfully. If not, apt tells me
> > what is still missing and I can start again ;)

The biggest problem I see is, that wget will always create a file, even
if it could not be downloaded correctly; apt might get very confused,
when it encounters such a file (or does it recognise this case?).

You should check the downloads or modify the wget-lines to create a
log-file as well.

> This is what I did in the end without the Python script.  I didn't want
> to copy 200 meg of debs into archives/ 

?? they will be copied there anyway. If you don't run 

     apt-get clean
or   apt-get auto-clean

they will even stay there.

> and as the option to specify the archive directory didn't work for me,
> I tried symlinking the entire directory of downloaded debs into the
> archives.

Try this:

mv /var/cache/apt/archives /var/cache/apt/archives.backup
ln -s /your/directory /var/cache/apt/archives"

If you have some files in your archive that are needed for the upgrade,
apt will complain that they are missing and you'll have to get them
again (or copy from archives.backup).

> That also didn't work.  :-(  In the end I had to copy it but I'd
> prefer to have a directory on my spare disk which Apt used as the
> cache.

tux@hex:tux $ll /var/cache/apt
total 6444
lrwxrwxrwx    1 root     root           23 Aug  1 20:26 archives -> /usr/local/apt/archives
-rw-r--r--    1 root     root      3360906 Sep  2 10:50 pkgcache.bin
-rw-r--r--    1 root     root      3264856 Sep  2 10:50 srcpkgcache.bin
tux@hex:tux $df 
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/hdc1                94647     42150     47610  47% /
/dev/hdc2               197657     91579     95872  49% /var
/dev/hdc5              2479816   1263548   1090296  54% /usr
/dev/hdc6              2480824   1571884    782920  67% /usr/local
/dev/hdc7              3844584   1728788   1920500  48% /home

Something like this? Works perfectly here.

> Thomas, could you email me that script?  It sounds like what I want to
> do, especially if I could get Dir::Cache::archive working.

See attachment. Sorry if you will get two copies, but I don't know if
I'll make it to the list.

Thomas

Attachment: ziplist.py.gz
Description: Binary data


Reply to: