Vagrant离线升级box

今天vagrant box update的时候,它提示box有新版本可用。

$ vagrant up httpd1
Bringing machine 'httpd1' up with 'virtualbox' provider...
==> httpd1: Checking if box 'ubuntu/trusty64' is up to date...
==> httpd1: A newer version of the box 'ubuntu/trusty64' is available! You currently
==> httpd1: have version '20160519.0.2'. The latest is version '20160602.0.0'. Run
==> httpd1: `vagrant box update` to update.
==> httpd1: VirtualBox VM is already running.

(好吧,现在才发现最后一句already running,不升级也可以照样用)

$ vagrant box update
==> httpd1: Checking for updates to 'ubuntu/trusty64'
    httpd1: Latest installed version: 20160519.0.2
    httpd1: Version constraints:
    httpd1: Provider: virtualbox
==> httpd1: Updating 'ubuntu/trusty64' with provider 'virtualbox' from version
==> httpd1: '20160519.0.2' to '20160602.0.0'...
==> httpd1: Loading metadata for box 'http://plamenatv.free.bg/up.html
==> httpd1: Adding box 'ubuntu/trusty64' (v20160602.0.0) for provider: virtualbox
    httpd1: Downloading: https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/20160602.0.0/providers/virtualbox.box
    httpd1: Progress: 2% (Rate: 70026/s, Estimated time remaining: 3:18:32)

但是下载速度奇慢。

于是我就用迅雷下载这个文件了。
.box文件可以解压出来。

把文件解压到~/.vagrant.d/boxes/20160602.0.0/virtualbox下面,再运行vagrant box update就识别了。
注意20160602.0这个名字需要与vagrant在前面列出的一致。

标签:vagrant

添加新评论