How to build locate command database in FreeBSD?

If the database has not been built, locate command will show the following error message:

locate: database too small: /var/db/locate.database

You can build/update the database by running ‘locate.updatedb‘ script.

run:
$ /usr/libexec/locate.updatedb