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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. gh api: Makes authenticated HTTP requests to the GitHub API and prints the response
  2. How to Install librw-dev software package in Ubuntu
  3. dvc gc: Remove unused files and directories from the cache or remote storage
  4. josm Command Examples
  5. joe Command Examples
  6. tlp-stat: command not found
  7. ptx Command Examples in Linux
  8. systemd-analyze: command not found
  9. How to fix the error “host key verification failed”
  10. cut: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright