0

What is the difference between

1: sudo add-apt-repository ppa:ppaname
&
2: sudo -E add-apt-repository ppa:ppaname

When I was using ubuntu 14.04, I had to use sudo -E add-apt-repository ppa:ppaname but now ubuntu 16.04 does not require that -E option.

The error I used to get on ubuntu 14.04 :

sudo add-apt-repository ppa:linrunner/tlp
Cannot add PPA: 'ppa:linrunner/tlp'
Please check that the PPA name or format is correct.
  • The error has nothing to do with sudo -E , but wiht the repository name itself. – Sergiy Kolodyazhnyy May 5 '16 at 16:20
  • 1
    Here is your answer. – Ron May 5 '16 at 16:21
3

From the sudo man page:

 -E          The -E (preserve environment) option indicates to the security policy that the user wishes to preserve their existing environment variables.  The security policy may return an error if the -E
             option is specified and the user does not have permission to preserve the environment.

Without knowing what the error you were getting when you didn't include the -E option in 14.04, I'm not sure how to answer your real question.. but it probably had to do with environment variables you already had for your local user and in 16.04 those same variables are either not needed or already present in the root user.

0

From the sudo man page:
-E, --preserve-env Indicates to the security policy that the user wishes to preserve their existing environment variables. The security policy may return an error if the user does not have permission to preserve the environment.
So it keeps your user environment when running as root. I'm not sure why that would have mattered for add-apt-repository... I did not need the -E option when using 14.04 (or any Ubuntu version).

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.