0

After an OS version upgrade I have the following strange problem:

% port
MacPorts 2.3.1
...

% sudo -i
# port
MacPorts 2.3.1

% sudo port
sudo: port: command not found

Furthermore, if I do it all from within tmux, port works there as well, so it might not be related to the version upgrade.

The only difference I found between the environment inside tmux and outside (while running sudo) is that sudo env outside tmux gives two entries: one is my regular, correct, entry, and the second is PATH=/usr/bin:/bin:/usr/sbin:/sbin, which apparently destroys the correct path.

What could be adding the second line? and how is it even possible to have those two lines?

Note: Additional checking found that the second setting is here even without using sudo (when not under tmux). I don't understand this...

Thanks!

3
  • Not sure about the 2 PATH entries, but I think you want to run sudo -i port, not just sudo port.
    – jimtut
    Jul 29, 2014 at 0:07
  • Thanks for the suggestion, but I've never seen sudo -i XXX used in generic instructions. I also don't see why it would be necessary to run ports from root's environment. As an example, here is a random quote from a random page that I had open: sudo port install portname +variant1 +variant2 … from MacPorts Wiki.
    – Shwouchk
    Jul 29, 2014 at 5:05
  • I also ran into the same problem, two PATH entries defined in env. really weird. Appeared after upgrading to yosemite.
    – cashmere
    Jan 26, 2015 at 23:02

0

You must log in to answer this question.

Browse other questions tagged .