【发布时间】:2016-11-28 18:00:28
【问题描述】:
我试着做vagrant up。
我在主机上的环境
- 微软视窗 10
- 虚拟盒子 5.1.10
- 流浪者 1.8.6
Vagrant 得到 box bento/debian-8.6,设置端口,挂载共享文件夹,然后返回错误
==> myvag: /vagrant/provision/prep_server.sh: line 2: $'\r': command not found
==> myvag: /vagrant/provision/prep_server.sh: line 4: $'\r': command not found
==> myvag: /vagrant/provision/prep_server.sh: line 10: $'\r': command not found
==> myvag: Updating Aptitude
==> myvag: /vagrant/provision/prep_server.sh: line 14: $'\r': command not found
==> myvag: Removing exim4
==> myvag: /vagrant/provision/prep_server.sh: line 20: $'\r': command not found
==> myvag: Performing an safe-upgrade
==> myvag: Reading changelogs...
==> myvag: Done with safe-upgrade
==> myvag: /vagrant/provision/prep_server.sh: line 25: $'\r': command not found
==> myvag: Adding dotdeb dependencies to apt sources if not there.
==> myvag: /vagrant/provision/prep_server.sh: line 27: $'\r': command not found
==> myvag: /vagrant/provision/prep_server.sh: line 30: $'\r': command not found
==> myvag: Adding dotdeb GPG Key
==> myvag: /vagrant/provision/prep_server.sh: line 42: syntax error: unexpected end of file
此文件的内容在下面
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
############ Ultimately, this is a HACK: ###############
## Because of libssl and heartbleed, there are some
## debian propts that come up and destroy screw up
## Our provisioning scripts in salt and make the output
## really funny.
# Update our packages data
echo "Updating Aptitude"
sudo aptitude update > /dev/null
# exim4 is the stupid package causing the prompt to occur.
# It was just easier to remove it than automate the lib's
# Upgrade screen.
echo "Removing exim4"
sudo aptitude purge -y -q -f exim4 > /dev/null
echo "Performing an safe-upgrade"
# Do an upgrade of the existing stuff
sudo -E bash -c 'aptitude safe-upgrade -y -f > /dev/null'
echo "Done with safe-upgrade"
echo "Adding dotdeb dependencies to apt sources if not there."
grep -q -F 'packages.dotdeb.org' /etc/apt/sources.list ||
echo "deb http://packages.dotdeb.org jessie all
deb-src http://packages.dotdeb.org jessie all" >> /etc/apt/sources.list
echo "Adding dotdeb GPG Key"
if ! apt-key list | grep -q -F 'dotdeb'; then
wget https://www.dotdeb.org/dotdeb.gpg
apt-key add dotdeb.gpg
rm dotdeb.gpg
else
echo "Dotdeb GPG Key present"
fi
echo "Updating apt-get"
apt-get update
据我了解,它可能与结尾\r\n 相关,但我该如何解决。
同时我的同事对vagrant up 没有问题,但他在主机上使用 Ubuntu。
【问题讨论】:
标签: vagrant debian windows-10 virtual-machine virtualbox