plocate updatedb /var/lib/plocate/: Is a directory error

plocate is a locate(1) based on posting lists, giving much faster searches
on a much smaller index. It is a drop-in replacement for mlocate in nearly
all aspects, and is fast on SSDs and non-SSDs alike.

But I’m having problem using it under WSL1.

$ plocate java
/var/lib/plocate/plocate.db: No such file or directory

$ sudo updatedb
/var/lib/plocate/: Is a directory

$ updatedb.plocate
/var/lib/plocate/: Is a directory

$ apt-cache policy plocate
  Installed: 1.1.8-2+deb11u1
  Candidate: 1.1.8-2+deb11u1
  Version table:
     1.1.13-1~bpo11+1 100
        100 bullseye-backports/main amd64 Packages
 *** 1.1.8-2+deb11u1 500
        500 bullseye/main amd64 Packages
        100 /var/lib/dpkg/status

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

Asked By: xpt


Update to 1.1.13-1~bpo11+1 fixed the problem:

sudo apt install -y plocate -t bullseye-backports

Answered By: xpt

This can happen if your kernel is very old (older than what is supported in bullseye), or you are using something pretending imperfectly to be the Linux kernel (like WSL1). A workaround was put in place in plocate 1.1.12.

Answered By: Steinar H. Gunderson

You have to update a database for plocate, I fixed the problem using:

sudo updatedb.plocate
Answered By: Worbein