Posts Tagged ‘locate’

How to fix: locate: can not open `/var/lib/mlocate/mlocate.db’: No such file or directory

February 14, 2009 - 2:29 pm 6 Comments

In the first of my “How to fix” posts where I detail how I fix various issues I run into, this is a simple one:

[root@vps etc]# locate courier
locate: can not open `/var/lib/mlocate/mlocate.db': No such file or directory

OK, so the mlocate.db file doesn’t exist, marvellous.  How do we either find it or create it?
Answer: simply run updatedb

[root@vps etc]# updatedb

Now we can do our search:

[root@vps etc]# locate courier
/etc/profile.d/courier-imap.csh
/etc/profile.d/courier-imap.sh
/etc/rc.d/init.d/courier-authlib
/etc/rc.d/init.d/courier-imap
/etc/rc.d/rc0.d/K30courier-imap
/etc/rc.d/rc0.d/K85courier-authlib
/etc/rc.d/rc1.d/K30courier-imap
...