How To Install mlocate on CentOS 8
Introduction
In this tutorial we learn how to install mlocate
on CentOS 8.
What is mlocate
mlocate is a locate/updatedb implementation. It keeps a database of all existing files and allows you to lookup files by name. The ’m’ stands for “merging” rereading most of the file system, which makes updatedb faster and does not trash the system caches as much as traditional locate implementations.
We can use yum
or dnf
to install mlocate
on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install mlocate.
Install mlocate on CentOS 8 Using dnf
Update yum database with dnf
using the following command.
sudo dnf makecache --refresh
The output should look something like this:
CentOS Linux 8 - AppStream 43 kB/s | 4.3 kB 00:00
CentOS Linux 8 - BaseOS 65 kB/s | 3.9 kB 00:00
CentOS Linux 8 - ContinuousRelease 43 kB/s | 3.0 kB 00:00
CentOS Linux 8 - Extras 23 kB/s | 1.5 kB 00:00
CentOS Linux 8 - FastTrack 40 kB/s | 3.0 kB 00:00
CentOS Linux 8 - HighAvailability 36 kB/s | 3.9 kB 00:00
CentOS Linux 8 - Plus 24 kB/s | 1.5 kB 00:00
CentOS Linux 8 - PowerTools 50 kB/s | 4.3 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 13 kB/s | 9.2 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 24 kB/s | 8.5 kB 00:00
Metadata cache created.
After updating yum database, We can install mlocate
using dnf
by running the following command:
sudo dnf -y install mlocate
Install mlocate on CentOS 8 Using yum
Update yum database with yum
using the following command.
sudo yum makecache --refresh
The output should look something like this:
CentOS Linux 8 - AppStream 43 kB/s | 4.3 kB 00:00
CentOS Linux 8 - BaseOS 65 kB/s | 3.9 kB 00:00
CentOS Linux 8 - ContinuousRelease 43 kB/s | 3.0 kB 00:00
CentOS Linux 8 - Extras 23 kB/s | 1.5 kB 00:00
CentOS Linux 8 - FastTrack 40 kB/s | 3.0 kB 00:00
CentOS Linux 8 - HighAvailability 36 kB/s | 3.9 kB 00:00
CentOS Linux 8 - Plus 24 kB/s | 1.5 kB 00:00
CentOS Linux 8 - PowerTools 50 kB/s | 4.3 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 13 kB/s | 9.2 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 24 kB/s | 8.5 kB 00:00
Metadata cache created.
After updating yum database, We can install mlocate
using yum
by running the following command:
sudo yum -y install mlocate
How To Uninstall mlocate on CentOS 8
To uninstall only the mlocate
package we can use the following command:
sudo dnf remove mlocate
mlocate Package Contents on CentOS 8
/etc/updatedb.conf
/usr/bin/locate
/usr/bin/updatedb
/usr/lib/.build-id
/usr/lib/.build-id/17
/usr/lib/.build-id/17/5326f225ab803c258877d104693960f55c357b
/usr/lib/.build-id/b9
/usr/lib/.build-id/b9/263a264647440df0781009cd882b5de6378bd3
/usr/lib/systemd/system/mlocate-updatedb.service
/usr/lib/systemd/system/mlocate-updatedb.timer
/usr/libexec/mlocate-run-updatedb
/usr/share/doc/mlocate
/usr/share/doc/mlocate/AUTHORS
/usr/share/doc/mlocate/COPYING
/usr/share/doc/mlocate/NEWS
/usr/share/doc/mlocate/README
/usr/share/locale/ar/LC_MESSAGES/mlocate.mo
/usr/share/locale/as/LC_MESSAGES/mlocate.mo
/usr/share/locale/ast/LC_MESSAGES/mlocate.mo
/usr/share/locale/bg/LC_MESSAGES/mlocate.mo
/usr/share/locale/bs/LC_MESSAGES/mlocate.mo
/usr/share/locale/ca/LC_MESSAGES/mlocate.mo
/usr/share/locale/cs/LC_MESSAGES/mlocate.mo
/usr/share/locale/da/LC_MESSAGES/mlocate.mo
/usr/share/locale/de/LC_MESSAGES/mlocate.mo
/usr/share/locale/el/LC_MESSAGES/mlocate.mo
/usr/share/locale/en_GB/LC_MESSAGES/mlocate.mo
/usr/share/locale/es/LC_MESSAGES/mlocate.mo
/usr/share/locale/et/LC_MESSAGES/mlocate.mo
/usr/share/locale/fa/LC_MESSAGES/mlocate.mo
/usr/share/locale/fi/LC_MESSAGES/mlocate.mo
/usr/share/locale/fr/LC_MESSAGES/mlocate.mo
/usr/share/locale/gu/LC_MESSAGES/mlocate.mo
/usr/share/locale/hu/LC_MESSAGES/mlocate.mo
/usr/share/locale/it/LC_MESSAGES/mlocate.mo
/usr/share/locale/ja/LC_MESSAGES/mlocate.mo
/usr/share/locale/ko/LC_MESSAGES/mlocate.mo
/usr/share/locale/lv/LC_MESSAGES/mlocate.mo
/usr/share/locale/ms/LC_MESSAGES/mlocate.mo
/usr/share/locale/nds/LC_MESSAGES/mlocate.mo
/usr/share/locale/nl/LC_MESSAGES/mlocate.mo
/usr/share/locale/pl/LC_MESSAGES/mlocate.mo
/usr/share/locale/pt/LC_MESSAGES/mlocate.mo
/usr/share/locale/pt_BR/LC_MESSAGES/mlocate.mo
/usr/share/locale/ru/LC_MESSAGES/mlocate.mo
/usr/share/locale/sr/LC_MESSAGES/mlocate.mo
/usr/share/locale/sr@latin/LC_MESSAGES/mlocate.mo
/usr/share/locale/sv/LC_MESSAGES/mlocate.mo
/usr/share/locale/ta/LC_MESSAGES/mlocate.mo
/usr/share/locale/tr/LC_MESSAGES/mlocate.mo
/usr/share/locale/uk/LC_MESSAGES/mlocate.mo
/usr/share/locale/zh_CN/LC_MESSAGES/mlocate.mo
/usr/share/locale/zh_TW/LC_MESSAGES/mlocate.mo
/usr/share/man/man1/locate.1.gz
/usr/share/man/man5/mlocate.db.5.gz
/usr/share/man/man5/updatedb.conf.5.gz
/usr/share/man/man8/updatedb.8.gz
/var/lib/mlocate
/var/lib/mlocate/mlocate.db
References
Summary
In this tutorial we learn how to install mlocate
on CentOS 8 using yum and dnf.