root@slackware:~# locate php.ini-recommended locate: fatal error: Could not find user database '/var/lib/slocate/slocate.db': No such file or directory
Don’t worry, that does not means your Linux locate command is not working. The error stated that ‘/var/lib/slocate/slocate.db’ could not be found. That means Linux doesn’t have locate database yet. What you can do is to run updatedb command. Login into command line terminal and su – to gain root privilege. See an example below for the complete steps:
luzar@slackware:~$ su - Password: root@slackware:~# updatedb
If you are using Ubuntu, use sudo updatedb command and provide your password.
The database update process will take some times. When it finished, you can try using Linux locate command again to search for file. To find a file in Linux system using locate command or to locate a file, we just invoke locate filename from the command line terminal.
Below is an example on how to search file using Linux locate command:
root@slackware:~# locate php.ini-recommended /etc/httpd/php.ini-recommended root@slackware:~#
Sometimes you’ll get warning when running locate command such as the example below:
root@slackware:~# locate php.ini-recommended locate: warning: database /var/lib/slocate/slocate.db' is more than 8 days old /etc/httpd/php.ini-recommended root@slackware:~#