Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Macports doesn't work:

sudo: cannot get working directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
error getting working directory name: no such file or directory
    while executing
"pwd"
    invoked from within
"set current_portdir [pwd]"
    (file "/opt/local/bin/port" line 4774)

Anyone an idea?

share|improve this question

migrated from stackoverflow.com May 23 '12 at 14:01

This question came from our site for professional and enthusiast programmers.

1  
Did you delete the directory you were in from another shell? –  Wooble May 23 '12 at 13:53
    
Is either your home dir or current working dir on a remote volume? It sounds like something that could happen if your authentication ticket expired while connected to a kerberized NFS share. –  DouglasDD May 24 '12 at 1:19

1 Answer 1

I had the same issue. It was caused by the fact that I just deleted the current directory by another script.

Changing the current directory to, for example, the home directory fixed the problem. So I just did:

cd ~/

After that I ran the Macports command again and everything worked.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.