sudo apt-get install git
此操作后将使用 21.9 MB 的额外磁盘空间。
是否继续?[Y/n]
我可以将确认值设置Y
为命令的选项/参数吗?例如, sudo apt-get install git -y
答案1
你可以,但请注意,该提示是为了保护你 - 不要轻易绕过它。
从man apt-get
:
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and
run non-interactively. If an undesirable situation, such as
changing a held package, trying to install a unauthenticated
package or removing an essential package occurs then apt-get will
abort. Configuration Item: APT::Get::Assume-Yes.