PDA

View Full Version : [Solved] -bash: locate: command not found & yum: No package locate available.



Fli
10-04-2019, 01:05 PM
ISSUE:

# locate filename
-bash: locate: command not found

# yum install locate
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
***
No package locate available.
Error: Nothing to do

SOLUTION:

# yum install slocate mlocate

then update the database index on background:

# updatedb &

maybe it will take a hour for it to index all files.

after it is finished, "# locate filename" command may stop showing "can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory" error.