Locate and updatedb doesn't work. What should I do?

Solution 1:

It was not installed and not in the directories listed by natxo, but I found a solution to install it. Thank you for the lead guys!

http://www.nicecabbage.com/2009/08/install-locate-and-updatedb-on-centos-and-debian/

In root: apt-get install locate

Solution 2:

I think you need to install the locate program. In a debian lenny system, the /usr/bin/updatedb file is a symlink to /etc/alternatives/updatedb which is a symlink to /usr/bin/updatedb.findutils.

Using dpkg -S you can find what package a file belongs to:

$ dpkg -S /usr/bin/updatedb.findutils 
locate: /usr/bin/updatedb.findutils

So I think you need to install locate and then run updatedb as root.

Edit: yes, you need the locate package. In the file /usr/share/doc/findutils/NEWS.Debian.gz you can read:

locate is no longer included in the findutils package. It has been split off to a separate package "locate".

and then in /usr/share/doc/findutils/changelog.Debian.gz, on the changelog on 11 nov 2007:

Split off locate/updatedb to a separate package.


Solution 3:

Must of the command that must be run as root are not in the user's $PATH so just run:

$ sudo updatedb

and it should work.

Tags:

Linux

Debian