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

Wish for apt-get



Hi,

using apt-get across a modem is quite expensive, so I hacked myself a
little script that runs apt to update just the package files and then
runs it in "simulation mode" just printing those "Inst package_xxx"
messages. The script then filters that output and compares it to the
database of available packages to produce a script which uses wget to
actually retrieve the packages. Thus I can run the script at work to
get the packages and install them to update my machine at home.

So far so good, but the script obviously fails when I have more than
one source for packages (more than one line in sources.list) because
it cannot know where to get the package from.

Could you add an option to apt-get that simulates the package
retrieval just like "-s" but instead of printing just the package
name, would print the full URL to get it, i.e.
instead of printing
Inst binutils
it would print
Inst ftp://ftp.mylocal.mirror/path/to/archive/binutils_x_y_z.deb

That would make remote downloading of packages much easier.

Thanks a lot for a great utility anyway, apt-get saves me a lot of
time browsing ftp sites.
I include my script for your information:
#!/bin/sh

ROOT="ftp://sunsite.doc.ic.ac.uk/public/Mirrors/ftp.debian.org/pub/debian/";

for i in `apt-get -q -s -y dist-upgrade | fgrep Inst | sed "1,$ s/^Inst //g"`
do
	LOCATION=`(fgrep $i /var/state/apt/lists/*| fgrep Filename | sed '1,$ s/^.*Filename: //g') 2>/dev/null` 
	echo "wget -q $ROOT$LOCATION"
done

Regards,
Karsten 
-- 
 Karsten Ballüder http://www.phy.hw.ac.uk/~karsten/ mailto:Ballueder@usa.net
 Physics Department, Heriot-Watt University, Edinburgh, EH14 4AS, Scotland
                     Tel. +44-(0)-131-4513068  Fax. +44-(0)-131-4513136
           "In a world without fences, who needs Gates?"  

Reply to: