How to resolve mlocate command not working issue on CentOS 7 or RHEL 7 ?

This is a common issue faced by one of my colleague and i prefer to share the solution here.

I found the problem faced by some of our team member when they are trying to use mlocate command however its not working.

For Rhel6, we have locate command.

However for Rhel7 we have mlocate. I have installed it but it is not working.

To get it worked, we need to follow below two steps:

1. Remove old mlocate Database.

# rm /var/lib/mlocate/mlocate.db

2. Update the Database now.

# updatedb

After this, the issue with mlocate should be resolved.

I have shared it on this blog, so that it could be helpful to you also.

Please do share improvements to this in comments.

Leave a Reply

Your email address will not be published.