流浪性条款不起作用

时间:2015-04-02 06:42:52

标签: vagrant

我在使用vagrant规定安装软件时遇到问题。我只是尝试安装git但是我收到了这个错误:

==> default: stdin: is not a tty
==> default:   git-email git-gui gitk gitweb diffutils-doc
==> default: The following NEW packages will be installed:
==> default:   git git-man liberror-perl patch
==> default: 0 upgraded, 4 newly installed, 0 to remove and 179 not   upgraded.
==> default: Need to get 6,730 kB of archives.
==> default: After this operation, 15.4 MB of additional disk space will be used.
==> default: Do you want to continue [Y/n]?
==> default: Abort.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

我的Vargantfile看起来如此:

Vagrant.configure(2) do |config|
 config.vm.box = "hashicorp/precise32"
 config.vm.provision "shell", path: "bootstrap.sh"
end

和我的bootstrap.sh完全包含:

#!/usr/bin/env bash
sudo apt-get update
sudo apt-get install git

我在mac和windows上尝试了它并得到了同样的错误,我正在使用vagrant 1.7.2

1 个答案:

答案 0 :(得分:9)

从引导程序文件安装东西时需要添加-y标志,否则系统会等待确认

sudo apt-get -y install git
相关问题