Apt-cache search errors on Debian (in a dreamplug)
I just got a Dreamplug and have been playing around with it, when for some reason apt-cache search started failing weirdly. Sometimes I got segmentation faults, sometimes it would just run with no output, taking up to a few minutes.
My apt version is 0.8.10.3, so a couple of old Debian bugs that recommended rm /var/cache/apt/*.bin (which has since the taken to filesystem name randomization since the time of the bug, so I actually needed to rm /var/cache/apt/*.bin*) seemed like it probably wouldn’t work. And indeed it didn’t.
There was also this guy’s “delete everything and let apt cache it out” solution, which also didn’t work.
Then I tried man apt-cache which almost immediately told me about apt-cache gencaches:
gencaches performs the same operation as apt-get check. It builds the source and package caches from the sources in sources.list(5) and from /var/lib/dpkg/status.
apt-get check fixed it. Possibly it wouldn’t have if I hadn’t deleted practically everything apt ever created, though, so I told you about my journey.
And, yes, I rm -rf‘d entire file structures almost blindly. Don’t do that.