Wednesday, December 06, 2006

apt-spy ... Segmentation fault ... sigh

Well, one of my favorite programs that I had been using on most of my debian boxen has been broken for some time now. The program is apt-spy. With the latest version 3.1-14.1 you might get something like this:
# apt-spy -d unstable -o ./output.sources.txt -w outputFile.txt -n 20
Couldn't find country LU . Skipping.

SERVER: ftp.at.debian.org
Benchmarking FTP...
Downloaded 4770019 bytes in 12.55 seconds
Download speed: 371.05 kB/sec
Benchmarking HTTP...
Downloaded 4770019 bytes in 11.22 seconds
Download speed: 415.06 kB/sec
Segmentation fault

Well, since I am an idiot, this is how I started dealing with this issue as root:
# cp -p /var/lib/apt-spy/mirrors.txt .
# apt-get --purge remove apt-spy
# wget -c http://ftp.debian.org/debian/pool/main/a/apt-spy/apt-spy_3.1-13_i386.deb
# dpkg -i apt-spy_3.1-13_i386.deb
# cp -p ./mirrors.txt /var/lib/apt-spy/.
# echo "apt-spy hold" | dpkg --set-selections

Now I do not get the Segmentation fault. But another long standing issue with apt-spy, as one poster has mentioned, is that
apt-spy ... will report 6 out of 7 servers as non-functioning, while in reality all except 1 are functioning

Well after investigating this issue a bit, it looks like the default file that apt-spy uses to test each repository is "/debian/ls-lR", while the repositories usually have no such file. More of the repositories appear to have a file called "/debian/ls-lR.gz" instead, imagine that.

So now my command line is something like this:
apt-spy -d unstable -f ls-lR.gz -o ./output.sources.txt -w outputFile.txt -n 20
And most of the servers get a hit off of this file.

You may also want to read my next post on this subject. Hope this helps someone.

6 comments:

Unknown said...

WOW
Just what i've been needing.
I don't understand line 2 but i'll figure it out.
lol
Dad
:)

Anonymous said...

Be sure to keep the /var/lib/apt-spy/mirrors.txt from the newer version of the package before replacing it with the older version of the package. You want the app not to segfault, but you still want the newer mirrors.txt.

Alternatively, grab the updated mirrors.txt with a 'wget http://http.us.debian.org/debian/README.mirrors.txt'

Anonymous said...

apt-spy update

Will get the latest mirrors for you.

Anonymous said...

Thanks Vernon. I really needed this tip. Have you filed a bug report?

Anonymous said...

thank you!
I'm disappointed the broken version has been left in place. Why don't they just make the working older version the active candidate when apt-get is run until the new version is fixed? (my terminology is wrong but you get my drift...)

Anonymous said...

I guess I spoke too quickly, even the recommended version in the post throws segfaults and other errors. I finally found the netselect-apt package which is maintained unlike apt-spy.