We have Centos 7.
Trying to use the 'locate' command yields nothing, even if the searched file[s] actually exist.
No error is printed.
Also executed 'sudo updatedb' to update the 'locate' indexes.
Any ideas?
Thank you
Centos - "locate" command doesn't work
To install the locate package, use yum:
$ yum install mlocate
To update it’s "internal database", run following command.
$ updatedb
Step 1: Go to the /etc/yum.repos.d/ directory.
cd /etc/yum.repos.d/
Step 2: Run the below commands
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-*
Step 3: Now run the yum update
yum update -y
© 2022 - 2024 — McMap. All rights reserved.
mlocate-updatedb.timer
service insystemctl
was not enabled during installation, so it would not persist between boots. ...and it is run by SystemD, notcron.daily
. Runsystemctl enable mlocate-updatedb.timer
until the patch is in place from upstream. – Jiva