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