linux locate: command not found

装好系统发现使用locate查找文件,提示

-bash: locate: command not found

yum install locate 无效,看来locate不是软件名称

[root@centos64 ~]# yum search locate 

============================= N/S Matched: locate ==============================
mlocate.x86_64 : An utility for finding files by name
which.x86_64 : Displays where a particular program in your path is located

[root@centos64 ~]# yum install mlocate

[root@centos64 ~]# locate mysql
locate: can not stat () `/var/lib/mlocate/mlocate.db': 没有那个文件或目录

[root@centos64 ~]# updatedb

完成。

原文地址:https://www.cnblogs.com/ShepherdIsland/p/linux_install_locate.html