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!
sudo -i port
, not justsudo port
.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.