【问题标题】:Vagrant provision not working流浪规定不起作用
【发布时间】:2015-06-07 00:47:58
【问题描述】:

我在使用 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

【问题讨论】:

    标签: vagrant


    【解决方案1】:

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

    sudo apt-get -y install git
    

    【讨论】:

      猜你喜欢
      • 2016-05-09
      • 2011-10-20
      • 1970-01-01
      • 2017-06-17
      • 2012-02-20
      • 1970-01-01
      • 2016-05-16
      • 1970-01-01
      • 2012-11-11
      相关资源
      最近更新 更多