Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

How can i update the cache / index of locate? I installed new packages and the files are clearly not yet indexed. So which command do I have to ommit, in order for the indexer to trigger.

I'm currently working on debian jessie (testing): with Linux mbpc 3.13-1-amd64 #1 SMP Debian 3.13.7-1 (2014-03-25) x86_64 GNU/Linux

share|improve this question

migrated from serverfault.com Apr 14 '14 at 18:49

This question came from our site for system and network administrators.

2 Answers 2

up vote 21 down vote accepted

The command is:

sudo updatedb

See man updatedb for more details.

share|improve this answer
as I remember you have to be root to do that, or sudo it –  David Apr 14 '14 at 8:11
And put it as a cron. –  Florin Asavoaie Apr 14 '14 at 8:17
If you're not root, you shouldn't be on ServerFault anyway... –  Jenny D Apr 14 '14 at 8:30
I meant one should run it as root –  David Apr 14 '14 at 9:04
@JennyD This isn't ServerFault... –  John Hunt Dec 1 '14 at 14:08

On OSX this is: sudo /usr/libexec/locate.updatedb

Which can be linked with: sudo ln -s /usr/libexec/locate.updatedb /usr/local/bin/updatedb

Seems silly to have to make a symbolic link for a standard unix command, but there it is.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.