I have two Macs: one runs Sequoia, the other runs Ventura.
On the Sequoia machine, I am using Apple’s native (and very dated) version of locate. While locate itself runs OK, I cannot update the database. After installing new packages (or individual apps from here or there), I need to be able to verify the locations of certain files and libraries. I would like to use locate for this job, but as the db is run only once per week, I cannot wait for the update!
I assumed it was possible to perform a manual update using the following command, but I get only an odd error message that doesn’t seem to be explained anywhere:
% sudo /usr/libexec/locate.updatedb
mktemp: too few X's in template ‘updatedb’
>>> ERROR
>>> Failed to create a temporary file for database generation.
What is the problem here… why does locate.updatedb fail?
man locate.updatedb says that a job at /System/Library/LaunchDaemons/com.apple.locate.plist is run 1/week. I attempted to change the frequency of this job, but was informed by my LaunchControl app that it was not possible to change the scheduling!
And so it seems I cannot manually update the database, and the OS has mutinied its root user (me) by locking me out of the ability to re-schedule.
AN OPTIONAL QUESTION (need not be answered as a condition of acceptance, and included here in the hope that the problems may be related)
I have installed MacPorts (a package manager) on both machines. As a “Plan B” I thought I would try to install the GNU locate on my Ventura machine. Unfortunately, for reasons that are not clear to me, running the updatedb command also fails:
% sudo /opt/local/libexec/gnubin/updatedb
gfind: '/Library/Caches/com.apple.aned': Operation not permitted
gfind: '/System/Library/Templates/Data/private/var/db/oah': Operation not permitted
gfind: '/System/Volumes/Data/Library/Caches/com.apple.aned': Operation not permitted
gfind: failed to read file names from file system at or below " No such file or directory
And in this case the GNU locate can find nothing because it cannot create a database!