locate: command not found

Error message:

-bash: locate: command not found

Cause:

Locate is not installed.

Solution:

Find your OS installation disk and in Server folder find package like : mlocate-* ,  for me it is mlocate-0.15-1.el5.2.x86_64.rpm , and install it.

[root@node1 Server]# rpm -Uvh mlocate-0.15-1.el5.2.x86_64.rpm
warning: mlocate-0.15-1.el5.2.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing… ########################################### [100%]
1:mlocate ########################################### [100%]

If you try to run locate again you will receive the following error:

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

To solve, run:

updatedb

Congratulations, you are able to run locate without any error!

Advertisements

One Response to locate: command not found

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: