Menu

centOS locate : command not found 问题解决

2017年3月21日 - php

学习Linux基础的过程中,学到locate配合updatedb指令查找文件时,遇到小问题。当我在web文件夹中创建了newFileOne空文件后,输入locate newFileOne指令,报错如下:QQ截图20170321145021,然后再使用updatedb指令更行数据库时再次报错,然后百度。。。解决之道:在root用户下输入yum -y install mlocate指令后就解决了。

[root@localhost /]#  yum -y install mlocate回车

出现:
Loaded plugins: fastestmirror
base                                                                                                                                         | 3.6 kB  00:00:00
extras                                                                                                                                       | 3.4 kB  00:00:00
updates                                                                                                                                      | 3.4 kB  00:00:00
(1/4): base/7/x86_64/group_gz                                                                                                                | 155 kB  00:00:00
(2/4): extras/7/x86_64/primary_db                                                                                                            | 139 kB  00:00:00
(3/4): updates/7/x86_64/primary_db                                                                                                           | 3.8 MB  00:00:01
(4/4): base/7/x86_64/primary_db                                                                                                              | 5.6 MB  00:00:09
Determining fastest mirrors
* base: mirror.steadfast.net
* extras: mirror.steadfast.net
* updates: mirror.steadfast.net
Resolving Dependencies
–> Running transaction check
—> Package mlocate.x86_64 0:0.26-6.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================
Package                                Arch                                  Version                                     Repository                           Size
====================================================================================================================================================================
Installing:
mlocate                                x86_64                                0.26-6.el7                                  base                                113 k

Transaction Summary
====================================================================================================================================================================
Install  1 Package

Total download size: 113 k
Installed size: 378 k
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/mlocate-0.26-6.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for mlocate-0.26-6.el7.x86_64.rpm is not installed
mlocate-0.26-6.el7.x86_64.rpm                                                                                                                | 113 kB  00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid     : “CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>”
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package    : centos-release-7-3.1611.el7.centos.x86_64 (@anaconda)
From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mlocate-0.26-6.el7.x86_64                                                                                                                        1/1
Verifying  : mlocate-0.26-6.el7.x86_64                                                                                                                        1/1

Installed:
mlocate.x86_64 0:0.26-6.el7

Complete!

 

然后再次输入指令: updatedb回车。完美解决。

分享
标签:,

6 thoughts on “centOS locate : command not found 问题解决

wind_php

终于好了。我的哥。




0



0
我是博主

这个博主亲测有效,如果大家遇到问题,欢迎指教。QQ : 1005093464。




0



0
兰亭序

修改评论框外观。




0



0

发表评论