How To Install mlocate on Fedora 34

mlocate is An utility for finding files by name

Introduction

In this tutorial we learn how to install mlocate on Fedora 34.

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 Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install mlocate.

Install mlocate on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 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 Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 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 Fedora 34

To uninstall only the mlocate package we can use the following command:

sudo dnf remove mlocate

mlocate Package Contents on Fedora 34

/etc/updatedb.conf
/usr/bin/locate
/usr/bin/updatedb
/usr/lib/.build-id
/usr/lib/.build-id/d0
/usr/lib/.build-id/d0/1aac3fbeb3701e6629c8a69c43ad18d788327c
/usr/lib/.build-id/d4
/usr/lib/.build-id/d4/a20083dd6978e46d0be9c09de8b7ea4d16959d
/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 Fedora 34 using yum and dnf.