To install locate we need install the packet:

CentOS/RHEL:
sudo yum install mlocate    

Debian/Ubuntu:
sudo apt install mlocate         

And update de internal DB to allow «Locate» command in /var/lib/mlocate/mlocate.db, only execute:

sudo updatedb