0

Is there a difference in outcome or application behaviour by installing packages with

sudo -i
apt install something

versus

sudo apt install something
4
  • It is the same thing as long as you do not use "I/O redirection". – FedonKadifeli Sep 1 '20 at 16:26
  • If that is the case, would you mind posting an answer stating so? – Miguel Bartelsman Sep 1 '20 at 16:47
  • Read man sudo. – waltinator Sep 1 '20 at 23:25
  • hey waltinator, thanks for the valuable contribution – Miguel Bartelsman Sep 2 '20 at 17:15
2

Is there a difference in outcome or application behaviour by installing packages with

No, but that is not what "sudo" is about.

1 of the key features of "sudo" is the ability to track and trace directly who issued the command. Where "sudo" logs it as the user that issued it. Doing it from "root" will log it as "root.

Not an issue for a single admin system but a serious problem when there is more than one admin on a system and a command was issued that was not supposed to be issued.

1
3

If you're talking solely about using the apt command, the two invocations are identical. Other commands that may depend on environment variables and such could potentially act differently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.