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

Got the below error while trying to use the locate command.

locate: can not stat () `/var/lib/mlocate/mlocate.db’: No such file or directory

The fix was pretty simple. Just ran the updatedb command. Locate started working just fine.

root@test1:~# updatedb
root@test1:~# locate jdk
/etc/profile.d/jdk.csh
/etc/profile.d/jdk.sh

Thanks.

 

Leave a Reply

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