Centos -“定位”命令不起作用

q8l4jmvw  于 2022-11-07  发布在  其他
关注(0)|答案(2)|浏览(171)

我们有Centos 7。
尝试使用“locate”命令不会产生任何结果,即使搜索的文件实际存在。
不打印错误。
还执行了“sudo updatedb”以更新“locate”索引。
有什么想法吗?
谢谢你

e5njpo68

e5njpo681#

要安装locate软件包,请使用yum:

$ yum install mlocate

要更新其“内部数据库”,请运行以下命令。

$ updatedb
6bc51xsx

6bc51xsx2#

步骤1:转到/etc/yum.repos.d/目录。

cd /etc/yum.repos.d/

步骤2:运行以下命令

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i  's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

步骤3:现在运行yum更新

yum update -y

相关问题