两者有什么区别?
1:sudo add-apt-repository ppa:ppaname
&
2:sudo -E add-apt-repository ppa:ppaname
当我使用ubuntu14.04时,我不得不使用sudo -E add-apt-repository ppa:ppaname,但是现在ubuntu16.04不需要这个-E选项。
我以前在ubuntu14.04上遇到的错误:
sudo add-apt-repository ppa:linrunner/tlp
Cannot add PPA: 'ppa:linrunner/tlp'
Please check that the PPA name or format is correct.发布于 2016-05-05 16:11:59
来自sudo手册页:
-E -E (保存环境)选项向安全策略指示用户希望保留他们现有的环境变量。如果指定了-E选项,且用户没有保留环境的权限,则安全策略可能返回错误。
当您在14.04中没有包含-E选项时,我不知道您所得到的错误是什么,我不知道如何回答您真正的问题。但这可能与本地用户已经拥有的环境变量有关,在16.04中,这些变量要么不需要,要么已经存在于根用户中。
发布于 2016-05-05 16:12:07
来自sudo手册页:
-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.
因此,当您以root用户身份运行时,它将保持您的用户环境。我不知道为什么这会影响到添加存储库.在使用14.04 (或任何Ubuntu版本)时,我不需要-E选项。
https://askubuntu.com/questions/768059
复制相似问题