After installing devtoolset 2, it appears my sudo command is broken.

readlink -f $(type -P sudo)


I believe the commands I ran to install devtoolset2 included the following after installation: (taken from SuperUser)

ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
sudo ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/

Can anyone confirm if this would have broken sudo somehow and why? My theory is that the ln -s was too aggressive and has also aliased sudo?


1 Answer 1


I think you should be fine.

What you've done is drop symlinks for items in /opt/rh/devtoolset-2/root/usr/bin/ into /usr/local/bin/(the location of custom binaries). This is most likely in your PATH variable as well and is most likely prioritized higher (in case you wanted to override something manually). sudo, however, is usually located at /usr/bin/sudo.

If you do a which -a sudo, you should see all matches for sudo.

You should be able to access sudo by typing something like: /usr/bin/sudo whoami.

  • Thanks Paul :) The reason I noticed the problem is that vagrant was not finding various commands when trying to halt the machine. I think vagrant uses something other than an interactive shell to do this but not 100% sure.
    – codecowboy
    Jan 13, 2016 at 10:09
  • No prob! Out of curiosity, did that end up working out for you okay? Jan 13, 2016 at 10:11
  • 1
    I think it did but I did things too quickly to be sure and which -a sudo is only giving one sudo path now. I manually deleted the symlink to sudo which seems to have solved things. I will therefore accept your answer :). Its a vagrant box so can be rebuilt if necessary. Feel free to upvote my question :)
    – codecowboy
    Jan 13, 2016 at 10:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .