1

What are the differences between

sudo make 

and

sudo -s make 

First example do not work with my software, there is always a header file missing. Login as root with sudo -s and compile works fine.

So what are the differences, wherefore sudo make is not working?

1 Answer 1

2

sudo -s runs the command as root in a shell referenced by the environment variable SHELL

sudo runs the command as root in the same shell as the original user

4
  • but I dont understand the differences for make, could you clarify that? Commented Jan 8, 2015 at 10:20
  • 1
    make depends on shell environment variables like PATH, HOME, LANG. If you change of shell those variables are different and can cause problems. Commented Jan 8, 2015 at 10:51
  • Usually the software is installed using sudo (for example: "sudo apt-get installl ..."), then the installation of the software modifies the PATH of the user; meanwhile the PATH of root keeps unchanged. root's shell lacks of information that has been integrated in the user environment. Commented Jan 8, 2015 at 10:58
  • ok just tried it on PATH example: sudo echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games and sudo -s ; echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Commented Jan 8, 2015 at 11:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.