macOS Mojave - locate not working I got a MacBook from my work and wanted to use the locate command, but I get the message:

WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:

  sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.


I ran sudo launchctl and waited some time... It's been two days and I still see that same message. If I ran sudo launchctl again I get: 

/System/Library/LaunchDaemons/com.apple.locate.plist: service already loaded


Searched for the database and:

$ ls -l /var/db/locate.database
ls: /var/db/locate.database: No such file or directory


The com.apple.locate.plist file is set with the predefined schedule to update on every Saturday at 3:15

&lt;key&gt;StartCalendarInterval&lt;/key&gt;
&lt;dict&gt;
    &lt;key&gt;Hour&lt;/key&gt;
    &lt;integer&gt;3&lt;/integer&gt;
    &lt;key&gt;Minute&lt;/key&gt;
    &lt;integer&gt;15&lt;/integer&gt;
    &lt;key&gt;Weekday&lt;/key&gt;
    &lt;integer&gt;6&lt;/integer&gt;
&lt;/dict&gt;


So, it shall update once it was executed for the first time. I'm under Mojave (v10.14.2), new MacBook with SSD and Core i7. locate should take few minutes to work on new machines, but it's not the case here.

Any ideas on why it isn't working and/or how to make it work?
Amigo, I might start with launchctl:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.locate.plist


Then check for any impediments to obtaining exclusive lock privilege on the nonexistent database:

sudo fuser -fu /private/var/db/locate.database
sudo lsof /private/var/db/locate.database


Then kill any process reported by either command.  Next, run the db generator by hand, preceded by an opensnoop for debugging if something goes wrong.  You will need to open a new terminal window ( command key - N shortcut, I believe ) and run opensnoop there, exiting it with a Control Key - c combo.

sudo opensnoop -cegx -f /private/var/db/locate.database 


Then over to your original window type:

sudo /usr/libexec/locate.updatedb


Remember to quit opensnoop with a cntrl-c in its window.  

F.