-bash: locate: command not found

转载:https://blog.csdn.net/huangyuhuangyu/article/details/80347250

部分版本的linux系统使用locate快速查找某文件路径会报以下错误:

-bash: locate: command not found
    
    
    
    


其原因是没有安装mlocate这个包

安装:yum  -y install mlocate

安装完再尝试用locate定位内容,发现依然不好使,报了新的错误:

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

-bash: locate: command not found_第1张图片

原因是安装完后没有更新库

更新库:updatedb

-bash: locate: command not found_第2张图片

你可能感兴趣的:(-bash: locate: command not found)