Ubuntu: user recognizes command but root doesn't


I installed arm-linux-g++ and added its directory to PATH and it recognizes the command. But when I try it with sudo it says command not found. I even tried adding its directory to bashrc--root but still nothing changed. How can I fix it?


sudo specifically ignores your PATH variable and uses its own. Compare echo "$PATH" with sudo sh -c 'echo "$PATH"'. Either put the command in one of the paths sudo trusts, or supply the full path to that particular command.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »