Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Error when update "locate" database

I'm running a Lion system (10.7.3) that was upgraded from Snow Leopard. I want to update the "locate" database. I tried what is prescribed everywehre I've searched on line:


sudo /usr/libexec/locate.updatedb


That gives errors:



shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

find: .: Permission denied


What's wrong and how does one fix this?


Note that now, whenever I try to use locate, I get no output; before I ran the locate.updatedb command, locate had been working as expected.

iMac, Mac OS X (10.7.3), 3.4GHz Corei7, 16GB, SSD + 2T HD

Posted on Feb 27, 2012 11:59 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 18, 2012 6:26 PM

I had the same problem, but I discovered that if I do


sudo

cd /

/usr/libexec/locate.updatedb


it works. Annoying, but it's enough of a work-around for me for now.

7 replies
Sort By: 

May 14, 2013 1:24 PM in response to Ray Lauff

What was suggested above didn't work for me.. typing "sudo" just gives me the help content, while "su" tells me "su: Sorry". Conversely "su -MYUSER" worked.


However, this single command DID work for me (clearly, I am an admin user):


sudo -u MYUSER /usr/libexec/locate.updatedb


😉


OSX: 10.8.3, Build 12D78 (semi-fresh OSX install)

Reply

Nov 2, 2015 2:50 AM in response to murrayE

Hi all,

I have been experiencing all kind of problems when updating the database of my Mac Os X.

I run Yosemite 10.10.5 on a Mac book Pro 13" ,late 2011.


I have tried

-- sudo /usr/libexec/locate.updatedb

from / directory tells me it doesn' t recognise "install" command at line 37 of locate.updatedb


-- sudo -u root /usr/libexec/locate.updatedb

same results


This is since one week now and I don't have anymore a locate.database in /var/db/ I tried to run locate once in order to re-create the database,

it suggests me to run

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


but when I do it, it tells me the same process is already on (this message appears since 10 days and still no database) ..


Can anyone help Please...

Thanks

Davide

Reply

Nov 2, 2015 8:01 AM in response to BobHarris

Thanks for the answer

I actually Done it already and nothing changed.

It seems the problem was at line 37 of /usr/libexec/locate.updatedb

it was not recognising the command install.

I used the locate.updatedb from this thread


Re: Where can I find ibSystem.B.dylib?


(Reply of Baltwo)

and it did the trick...

up and running again..

Thanks anyway.

Cheers,

Davide

Reply

Error when update "locate" database

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.