locate: can not stat () `/var/lib/mlocate/mlocate.db’

Run updatedb first.  You can run it manually from the command line.

updatedb

It should have scheduled itself as a cron job when you installed slocate.  If you just installed slocate, it will not have run yet.  Otherwise, make sure you have a cron daemon running and that there is an updatedb task scheduled.  Also, make sure your computer is on when it it is scheduled

If this is a VM and does not run continuously especially never spent days on this will happen. Just in case check the cron job found here:

The cron job is found here:

/etc/cron.daily/mlocate.cron

Thats’ pretty much it.

1 Reply to “locate: can not stat () `/var/lib/mlocate/mlocate.db’”

  1. Quick question about updedatb’s very deep hiearchy test.The path generated goes way past PATH_MAX, which causes problems with gentoo’s sandbox. To work around this I shortened the names of the directories generated to just a number, which allows the same number of directories but all with shorter names.Is this an acceptable solution, or does it defeat the purpose of the test?Thanks,Brennan

Leave a Reply

Your email address will not be published. Required fields are marked *