sudo broken -- how to fix?

Discussion in 'Mac Apps and Mac App Store' started by PaulFXH, Sep 13, 2008.

  1. PaulFXH macrumors member

    Joined:
    Aug 31, 2007
    #1
    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:
    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
    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?
     
  2. boast macrumors 65816

    boast

    Joined:
    Nov 12, 2007
    Location:
    Phoenix
  3. PaulFXH thread starter macrumors member

    Joined:
    Aug 31, 2007
    #3
    Well, that indeed was my intention but when I try
    Code:
    /usr/bin/sudo port uninstall sudo
    I get
    I'm confused :(
     
  4. boast macrumors 65816

    boast

    Joined:
    Nov 12, 2007
    Location:
    Phoenix
    #4
    what do you get with which sudo or echo $PATH
     
  5. PaulFXH thread starter macrumors member

    Joined:
    Aug 31, 2007
    #5
    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
    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.
     
  6. PaulFXH thread starter macrumors member

    Joined:
    Aug 31, 2007
    #6
    @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
     

Share This Page