Bug#1116965: dlocate relies on /var/lib/dpkg/available, unavailable on trixie and newer systems

Lee Garrett <[email protected]>
Newsgroups gmane.linux.debian.devel.dpkg.bugs
Message-ID <f621e8d3-2f3e-473f-8f79-2c483e320294__2920.03796655393$1759414411$gmane$org@rocketjump.eu>
Hi Guillem!

On 02/10/2025 04:36, Guillem Jover wrote:
> Control: severity -1 important
> 
> Hi!
> 
> On Wed, 2025-10-01 at 13:45:13 +0200, Lee Garrett wrote:
>> Source: dlocate
>> Version: 1.17
>> Severity: grave
>> X-Debbugs-Cc: [email protected]
> 
>> on a fresh trixie install, /etc/cron.daily/dlocate will fail every day with
>> following email:
>>
>> /etc/cron.daily/dlocate:
>> grep-available: /var/lib/dpkg/available: No such file or directory
>>
>> The call chain is:
>> /etc/cron.daily/dlocate -> /usr/sbin/update-dlocatedb -> /usr/share/dlocate/update-dpkg-list
>>
>> This file doesn't seem to be created on trixie systems, and on my upgraded
>> systems /var/lib/dpkg/available seems to be at least 5 years old. It seems
>> to have been created in the past with `dpkg --update-avail`, dlocate should
>> ensure this is being called and the file is current before depending on
>> the existence of the file.
> 
> dlocate uses the available database to replicate what dpkg used to
> print in its «dpkg-query --list» output, but that one has also since
> stopped loading the available file by default.
> 
> dlocate cannot know from where to update the available file from, most
> probably from apt, but another frontend could be in use. I don't think
> it would be safe for anything else to remove the available file
> either.
> 
> I've locally switched the grep-available calls to use «dpkg --print-avail»
> instead which does not fail with a non-existent available database file.
> I'll probably file a report against dctrl-tools so that grep-available
> does not fail on a non-existent available database file.

I agree that both `dpkg --print-avail`, and also a bug report against 
dctrl-tools are good choices.

> 
> Besides that, I think, that at least in your present but stale case your
> best option is to run something like «dpkg --clear-avail» or simply
> remove the available database file.

It's not directly releated to dlocate, but I'm wondering if this file was 
regularly updated in past releases. At least my quick search on codesearch.d.o 
did not bring up any meaningful results.

> 
>> I've set the severity to grave, since AFAICS this will cause dlocate to either
>> not work or work with several years old stale data.
> 
> The stale data would only affect the non-installed package listing,
> which does not seem grave to me. I've lowered it to important, because
> the cron spam can be very annoying.

Sounds sensible to me, ack. :)

> 
> I'm uploading a fix right away, and will probably prepare a stable
> update once this release hits testing.

Cool, thanks for the quick reply! Looking forward to a fix in the point release 
then.

> 
> Thanks,
> Guillem

Greetings,
Lee
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.