Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to remove with purge all entries of locate and its database.

I tried

apt-get purge locate


rm /etc/updatedb*

But is the database gone also?
Where is the updatedb database located on debian squeeze?

I would like to delete it manually too, so I can cleanly reinstall it

share|improve this question

man updatedb

search for 'FILES'

mine says:

              A configuration file.  See updatedb.conf(5).

              The database updated by default.
share|improve this answer
That's mlocate, not locate. Though /var/lib/locate is not a bad guess for locate. – Dennis Kaarsemaker Dec 1 '12 at 11:36
I'm trying to give both general advice and the results of following said advice on my system. – ptman Dec 1 '12 at 11:39
Oh, and it seems like mlocate is the standard locate on Debian. – ptman Dec 1 '12 at 11:43
mlocate is not installed, neither slocate – rubo77 Dec 2 '12 at 8:09
up vote 2 down vote accepted

On debian, the locate database is stored by default in


If you use mlocate as search indexer:

The mlocate database is stored at


see: How can I view updatedb database content, and then exclude certain files/paths?

share|improve this answer

I prefer to just strace the process, as it's going to lead you right there. This will be distribution agnostic and works if you don't have the man pages.

# strace updatedb 2>&1 |grep ^open|grep db

open("/etc/updatedb.conf", O_RDONLY)    = 3
open("/var/lib/mlocate/mlocate.db", O_RDWR) = 3
open("/var/lib/mlocate/mlocate.db.bUUaw4", O_RDWR|O_CREAT|O_EXCL, 0600) = 4
share|improve this answer

There is /no way/ to determine where the database is other than decompiling the executable. If you have an /etc/updatedb.conf, you can look in there. I don't. You can read the man page for locate, which says the default location is /var/cache/locate/locatedb. Mine isn't there. You can use locate itself to search for files named "updatedb" or "locatedb", the two most-common prefixes for the config and database files. My system doesn't use either. I'm using Cygwin on Windows 7.

share|improve this answer
and if you search for mlocate.db? – rubo77 Oct 19 '13 at 21:06
@phil-goetz There's no need to decompile. You can get the exact location with a one-liner if you have strace installed: $ sudo strace updatedb 2>&1 | grep -o "^open.*O_RDWR.*" – Cengiz Can Sep 4 '14 at 7:23

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.