0

I have Ubuntu 22.04.2 LTS installed on my Raspberry Pi and I try to find/open the file /var/lib/mlocate.db but I cannot find it.

I installed locate package.

It's because I'm doing an online course from Linux Professional Institute (LPI) and I read this passage:

One problem with locate is that it only shows entries present in the database generated by updatedb (located in /var/lib/mlocate.db). If the database is outdated, the output could show files that have been deleted since the last time it was updated. One way to avoid this is to add the -e parameter, which will make it check to see if the file still exists before showing it on the output.

So I would like to see the database.

4
  • 1
    That database is updated with a cron job / systemd timer. You can either wait for a day for that job to run, or start it manually (sudo updatedb). See man locatedb for documentation about the format. It's binary, so opening it with a text editor won't be very useful.
    – HuHa
    Mar 21, 2023 at 19:40
  • 1
    Did you install mlocate or plocate? If the latter, please run: sudo updatedb and then check /var/lib/plocate/plocate.db.
    – chili555
    Mar 21, 2023 at 19:43
  • AFAIK Ubuntu now uses plocate as the default - see Jammy Jellyfish Release Notes Mar 21, 2023 at 19:58
  • Thank you @HuHa @chili555 and @steeldriver. Yes with Ubuntu version 22.04.2 LTS (Jammy Jellyfish), I installed plocate (not mlocate) so the binary file /var/lib/mlocate.db referred in the LPI passage in my question, its equivalent for plocate is located there /var/lib/plocate/plocate.db. Mar 24, 2023 at 13:41

0

You must log in to answer this question.

Browse other questions tagged .