Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

PaulFXH

macrumors member
Original poster
Aug 31, 2007
71
5
Yesterday, I installed MacPorts. However, due to a copy/paste error I seem to have installed the MacPort sudo.
So, for a while when I used sudo in a terminal I got this error:
sudo: can't stat /opt/local/etc/sudoers: No such file or directory
So, I unstalled MacPorts and re-installed it again without installing the MacPort sudo.
However, it didn't really fix the problem as now when I use sudo in a terminal I get
-bash: /opt/local/bin/sudo: No such file or directory
This looks like my Paths are messed up but apparently the desired path (/usr/bin) is still there:
Code:
$ $PATH
-bash: /opt/qt4/bin:/opt/kde4/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin: No such file or directory
I can, of course, still get sudo to work in a terminal just by typing "/usr/bin/sudo" rather than just "sudo".
Nevertheless, I want to get back to just using sudo.
Can anybody please help?
 
Well, it seems to be fixed now, but I really do not at all understand how.
In desperation, I tried a dv switch in the uninstall command
Code:
$ /usr/bin/sudo port -dv uninstall sudo
which gave this output
DEBUG: Registry error: sudo not registered as installed.
while executing
"registry::installed $portname $v"
(procedure "portuninstall::uninstall" line 5)
invoked from within
"portuninstall::uninstall $portname [composite_version $portversion [array get variations]] [array get options]"
Error: port uninstall failed: Registry error: sudo not registered as installed.
However, now I can use sudo without /usr/bin/sudo and everything seems normal.
If anybody understands why this seems to have worked, please post.
 
@boast
I didn't see the edit to your last post until after I posted.
Here's what I get now after the fix:
Code:
$ which sudo
/usr/bin/sudo

$ echo $PATH
/opt/qt4/bin:/opt/kde4/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.