Ask Different is a question and answer site for power users of Apple hardware and software. 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

I have been having problem with installing gettext package from macports. When I am launching

 /opt/local/bin/port -v install apache2

it checks dependencies, and continues with gettext package installation. But the configure process freezes here:

checking for egrep... /usr/bin/grep -E

and nothing happens.. can wait hours, nothing changes.

I tried to configure, make, make install manually for that package and it went all fine. But, when same configure is launched by ports, it hangs there. Question:

1) How can that be fixed? 2) Maybe I can somehow manually tell ports, that I installed that gettext package manually already?

Sorry, if wrong "site" for this question. Felt most proper one.

sudo port -v install apache2 solved the problem :/

still unbelievable, that same operation from root user was hanging..

share|improve this question

migrated from Sep 2 '12 at 22:47

This question came from our site for system and network administrators.

You should run as sudo /opt/local/bin/port -v install apache2 so that it runs as the correct user – Mark Sep 2 '12 at 22:54
oh my. i was launching it from root user, entering it via sudo su – jancha Sep 3 '12 at 8:27
Mark, post your comment as answer - so I can mark it as resolution. – jancha Sep 3 '12 at 8:30
up vote 1 down vote accepted

You need to run macport port command as root best using port as shown in all the examples in the Macports guide This is so that all the processes are set up as the correct user and the files are saved no changeable by other users.

e.g. sudo /opt/local/bin/port -v install apache2

share|improve this answer

Found this answer at

If you are having issues with the installation of gettext and other packages hanging on macports, its most probably due to JAVA_HOME not being set. Set it and it should work:

# export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework
# /opt/local/bin/port install gettext

You probably have JAVA_HOME set in your user's environment, but not in root's. While logged in as root, I set JAVA_HOME and successfully built gettext. I've since added this to ~root/.profile so I don't have to remember it in 6 months...

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.