Locate tool won’t work, how do I fix
The command to update the database is

sudo /usr/libexec/locate.updatedb


It should get run automatically every week from /System/Library/LaunchDaemons/com.apple.locate.plist but you can run it manually if required.