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

By Druss , 6 February, 2012

On an Ubuntu box, I tried using the locate command to find information about a package and ran into the following error:

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

The locate program (should) routinely builds a database of files on the box and searches it when we call it. As the error message states, this database appears to be missing thereby leading to the error. Fixing it is as simple as calling:
updatedb

which should build the database.

Hope this helps!

All times are UTC. All content licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.