Centos - "locate" command doesn't work

user3139774 picture user3139774 · May 15, 2016 · Viewed 20.9k times · Source

We have Centos 7.
Trying to use the 'locate' command yields nothing, even if the searched file[s] actually exist.
No error is printed.
Also executed 'sudo updatedb' to update the 'locate' indexes.

Any ideas?

Thank you

Answer

l'L'l picture l'L'l · May 15, 2016

To install the locate package, use yum:

$ yum install mlocate

To update it’s "internal database", run following command.

$ updatedb