Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
    invoked from within
"set current_portdir [pwd]"
    (file "/opt/local/bin/port" line 4774)

Anyone an idea?

share|improve this question

migrated from May 23 '12 at 14:01

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

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

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

You must log in to answer this question.