• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

updatedb: command not found

by admin

The updatedb command is used to build a database of files based on the /etc/updatedb.conf file. This command is used to update the /var/lib/mlocate/mlocate.db database. The /etc/updatedb.conf file consists of the paths that should be excluded while building the database. To add a path that needs to be excluded while building the database, open the /etc/updatedb.conf file and, in the PRUNEPATH variable, specify the path that need not be included while building the database. For example, PRUNEPATH=”/etc” will exclude the /etc directory while building the database.

Though this is the default database searched by the locate command, there may be more databases containing file paths. If the database is not updated before performing a search, all files created after the last update will be excluded from the search.

If you encounter below error while running the updatedb commnad:

updatedb: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install mlocate
Ubuntu apt-get install mlocate
Alpine apk add mlocate
Arch Linux pacman -S mlocate
Kali Linux apt-get install mlocate
CentOS yum install mlocate
Fedora dnf install mlocate
Raspbian apt-get install mlocate

updatedb Command Examples

1. Refresh the slocate database, excluding files in temporary locations:

# updatedb -e "/tmp,/var/tmp,/usr/tmp,/afs,/net,/proc"

2. to create an index yourself of a directory and all its subdirectories (say, storing it in /tmp/myindex), run:

# updatedb -l0 -U directory -o /tmp/myindex

3. Refresh database content:

# updatedb

4. Display file names as soon as they are found:

# updatedb --verbose

Filed Under: Linux

Some more articles you might also be interested in …

  1. ceph: command not found
  2. a2disconf Command Examples in Linux
  3. login Command Examples in Linux
  4. gnome-screenshot Command Examples in Linux
  5. How to recover from deleted root entry in /etc/shadow and/or /etc/passwd files in CentOS / RHEL 6
  6. elinks Command Examples in Linux
  7. pstree Command Examples in Linux
  8. eject Command Examples in Linux
  9. How To Configure Separate Override.conf For Multiple MySQL Instances Using Systemd
  10. fwupdmgr: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright