我们使用Virtualbox + Vagrant虚拟环境
问题是我们使用的vbox不再受支持,因此虚拟机的新实例无法正常工作(现有的实用工具很棒)
这是我的流浪文件
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ubuntu32"
config.vm.provision :shell, :path => "vagrant/inicio.sh"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-i386-vagrant-disk1.box"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
config.vm.network :forwarded_port, guest: 80, host: 8107, auto_correct: true
config.vm.network :forwarded_port, guest: 4000, host: 4001, auto_correct: true
config.vm.provider "virtualbox" do |v|
v.name = "mallorcagolftours-white"
end
end
这是我的inicio.sh文件:
#!/usr/bin/env bash
if [ ! -f ~/initial_provosioning_done ];
then
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y -q lamp-server^ php5-gd
sed -i 's,www-data,vagrant,g' /etc/apache2/envvars
sed -i 's,/var/www,/vagrant/www,g' /etc/apache2/sites-available/default
sed -i 's,AllowOverride None,AllowOverride All,g' /etc/apache2/sites-available/default
mysqladmin -u root password root
zcat /vagrant/bd/script.sql.gz | mysql -uroot -proot
rm -r /var/lock/apache2
a2enmod rewrite
service apache2 restart
touch ~/initial_provosioning_done
fi
问题在于,当我像往常一样运行vagrant up
时,我收到了这个错误:
Err http://archive.ubuntu.com raring/main i386 Packages
404 Not Found [IP: 91.189.91.14 80]
Err http://archive.ubuntu.com raring/restricted i386 Packages
404 Not Found [IP: 91.189.91.14 80]
Err http://archive.ubuntu.com raring/universe i386 Packages
404 Not Found [IP: 91.189.91.14 80]
Err http://archive.ubuntu.com raring/multiverse i386 Packages
404 Not Found [IP: 91.189.91.14 80]
Err http://archive.ubuntu.com raring-updates/main i386 Packages
404 Not Found [IP: 91.189.91.14 80]
Err http://archive.ubuntu.com raring-updates/restricted i386 Packages
404 Not Found [IP: 91.189.91.14 80]
Err http://archive.ubuntu.com raring-updates/universe i386 Packages
404 Not Found [IP: 91.189.91.14 80]
Err http://archive.ubuntu.com raring-updates/multiverse i386 Packages
404 Not Found [IP: 91.189.91.14 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/binary-i386/Packages 404 Not Found [IP: 91.189.88.149 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/restricted/binary-i386/Packages 404 Not Found [IP: 91.189.88.149 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-i386/Packages 404 Not Found [IP: 91.189.88.149 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.88.149 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/main/binary-i386/Packages 404 Not Found [IP: 91.189.91.14 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/restricted/binary-i386/Packages 404 Not Found [IP: 91.189.91.14 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/universe/binary-i386/Packages 404 Not Found [IP: 91.189.91.14 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.91.14 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/main/binary-i386/Packages 404 Not Found [IP: 91.189.91.14 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/restricted/binary-i386/Packages 404 Not Found [IP: 91.189.91.14 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/universe/binary-i386/Packages 404 Not Found [IP: 91.189.91.14 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.91.14 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
请注意:我在Mac OS中使用带有虚拟框的流浪者
-EDIT-
我试过这个vbox:
http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box
然后我得到了这个错误:
frontend1:mallorcagolftours_white marcos$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu32'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: mallorcagolftoursWhite
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2202.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 80 => 8108 (adapter 1)
default: 4000 => 4001 (adapter 1)
default: 22 => 2202 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2202
default: SSH username: vagrant
default: SSH auth method: private key
default: Error: Connection timeout. Retrying...
default: Error: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.2.10
default: VirtualBox Version: 4.3
==> default: Mounting shared folders...
default: /vagrant => /Users/marcos/Desktop/Proyectos/mallorcagolftours_white
==> default: Running provisioner: shell...
default: Running: /var/folders/g9/v839m34x1t3fz63r0dqbs27m0000gn/T/vagrant-shell20140805-6746-a3uai1
Ign http://security.ubuntu.com raring-security Release.gpg
Ign http://security.ubuntu.com raring-security Release
Ign http://security.ubuntu.com raring-security/main i386 Packages/DiffIndex
Ign http://security.ubuntu.com raring-security/restricted i386 Packages/DiffIndex
Ign http://archive.ubuntu.com raring Release.gpg
Ign http://security.ubuntu.com raring-security/universe i386 Packages/DiffIndex
Ign http://security.ubuntu.com raring-security/multiverse i386 Packages/DiffIndex
Ign http://archive.ubuntu.com raring-updates Release.gpg
Ign http://archive.ubuntu.com raring Release
Ign http://archive.ubuntu.com raring-updates Release
Ign http://archive.ubuntu.com raring/main i386 Packages/DiffIndex
Ign http://archive.ubuntu.com raring/restricted i386 Packages/DiffIndex
Ign http://archive.ubuntu.com raring/universe i386 Packages/DiffIndex
Ign http://archive.ubuntu.com raring/multiverse i386 Packages/DiffIndex
Ign http://archive.ubuntu.com raring-updates/main i386 Packages/DiffIndex
Ign http://archive.ubuntu.com raring-updates/restricted i386 Packages/DiffIndex
Ign http://archive.ubuntu.com raring-updates/universe i386 Packages/DiffIndex
Ign http://security.ubuntu.com raring-security/main Translation-en
Ign http://archive.ubuntu.com raring-updates/multiverse i386 Packages/DiffIndex
Ign http://security.ubuntu.com raring-security/multiverse Translation-en
Ign http://security.ubuntu.com raring-security/restricted Translation-en
Ign http://security.ubuntu.com raring-security/universe Translation-en
Err http://security.ubuntu.com raring-security/main i386 Packages
404 Not Found [IP: 91.189.88.153 80]
Err http://security.ubuntu.com raring-security/restricted i386 Packages
404 Not Found [IP: 91.189.88.153 80]
Err http://security.ubuntu.com raring-security/universe i386 Packages
404 Not Found [IP: 91.189.88.153 80]
Err http://security.ubuntu.com raring-security/multiverse i386 Packages
404 Not Found [IP: 91.189.88.153 80]
Ign http://archive.ubuntu.com raring/main Translation-en
Ign http://archive.ubuntu.com raring/multiverse Translation-en
Ign http://archive.ubuntu.com raring/restricted Translation-en
Ign http://archive.ubuntu.com raring/universe Translation-en
Ign http://archive.ubuntu.com raring-updates/main Translation-en
Ign http://archive.ubuntu.com raring-updates/multiverse Translation-en
Ign http://archive.ubuntu.com raring-updates/restricted Translation-en
Ign http://archive.ubuntu.com raring-updates/universe Translation-en
Err http://archive.ubuntu.com raring/main i386 Packages
404 Not Found [IP: 91.189.91.15 80]
Err http://archive.ubuntu.com raring/restricted i386 Packages
404 Not Found [IP: 91.189.91.15 80]
Err http://archive.ubuntu.com raring/universe i386 Packages
404 Not Found [IP: 91.189.91.15 80]
Err http://archive.ubuntu.com raring/multiverse i386 Packages
404 Not Found [IP: 91.189.91.15 80]
Err http://archive.ubuntu.com raring-updates/main i386 Packages
404 Not Found [IP: 91.189.91.15 80]
Err http://archive.ubuntu.com raring-updates/restricted i386 Packages
404 Not Found [IP: 91.189.91.15 80]
Err http://archive.ubuntu.com raring-updates/universe i386 Packages
404 Not Found [IP: 91.189.91.15 80]
Err http://archive.ubuntu.com raring-updates/multiverse i386 Packages
404 Not Found [IP: 91.189.91.15 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/binary-i386/Packages 404 Not Found [IP: 91.189.88.153 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/restricted/binary-i386/Packages 404 Not Found [IP: 91.189.88.153 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-i386/Packages 404 Not Found [IP: 91.189.88.153 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.88.153 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/main/binary-i386/Packages 404 Not Found [IP: 91.189.91.15 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/restricted/binary-i386/Packages 404 Not Found [IP: 91.189.91.15 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/universe/binary-i386/Packages 404 Not Found [IP: 91.189.91.15 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.91.15 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/main/binary-i386/Packages 404 Not Found [IP: 91.189.91.15 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/restricted/binary-i386/Packages 404 Not Found [IP: 91.189.91.15 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/universe/binary-i386/Packages 404 Not Found [IP: 91.189.91.15 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.91.15 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
libclass-isa-perl is already the newest version.
libswitch-perl is already the newest version.
libwrap0 is already the newest version.
perl is already the newest version.
perl-modules is already the newest version.
tcpd is already the newest version.
The following extra packages will be installed:
libgd2-xpm
Suggested packages:
apache2-doc apache2-suexec apache2-suexec-custom php-pear libgd-tools
libipc-sharedcache-perl tinyca mailx openssl-blacklist
The following packages will be REMOVED:
libgd2-noxpm
The following NEW packages will be installed:
apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common
libaio1 libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
libaprutil1-ldap libdbd-mysql-perl libdbi-perl libgd2-xpm
libhtml-template-perl libmysqlclient18 libnet-daemon-perl libplrpc-perl
libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common
mysql-server mysql-server-5.5 mysql-server-core-5.5 php5-cli php5-common
php5-gd php5-mysql ssl-cert
0 upgraded, 30 newly installed, 1 to remove and 0 not upgraded.
Need to get 36.0 MB of archives.
After this operation, 119 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
libgd2-xpm libaio1 mysql-common libmysqlclient18 libnet-daemon-perl
libplrpc-perl libdbi-perl libdbd-mysql-perl mysql-client-core-5.5
libterm-readkey-perl mysql-client-5.5 mysql-server-core-5.5 mysql-server-5.5
php5-common php5-cli libapr1 libaprutil1 libaprutil1-dbd-sqlite3
libaprutil1-ldap apache2.2-bin apache2-utils apache2.2-common
apache2-mpm-prefork libapache2-mod-php5 php5-gd php5-mysql apache2
libhtml-template-perl mysql-server ssl-cert
E: There are problems and -y was used without --force-yes
sed: can't read /etc/apache2/envvars: No such file or directory
sed: can't read /etc/apache2/sites-available/default: No such file or directory
sed: can't read /etc/apache2/sites-available/default: No such file or directory
/tmp/vagrant-shell: line 10: mysqladmin: command not found
/tmp/vagrant-shell: line 11: mysql: command not found
rm: cannot remove '/var/lock/apache2': No such file or directory
/tmp/vagrant-shell: line 13: a2enmod: command not found
apache2: unrecognized service
有什么想法吗?
答案 0 :(得分:6)
Ubuntu 13.04(Raring)于2014年1月27日达到使用寿命。这意味着它不再受支持,其中一个影响是repos不再具有该版本所需的特定软件包。
您应该使用仍处于活动状态的Ubuntu版本(最好是LTS版本:请参阅here)或更改您的存储库列表以指向old-releases.ubuntu.com。
在第一种情况下,您需要编辑Vagrantfile,添加正确的框并删除已编码的网址:
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ubuntu/trusty32"
config.vm.provision :shell, :path => "vagrant/inicio.sh"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
# config.vm.box_url SHOULD BE REMOVED!
在第二种情况下,您的/etc/apt/sources.list
应该包含以下条目:
deb http://old-releases.ubuntu.com/ubuntu/ raring main
deb http://old-releases.ubuntu.com/ubuntu/ raring universe
# (...)