LoginSignup
3
3

More than 5 years have passed since last update.

Vagrantをバージョンアップしてみた【途中エラーが出ましたが、無事にバージョンアップ完了】

Posted at

はじめに

Vagrantのバージョンアップを行ったところ、途中でエラーが出たのでエラーを解消しながら、バージョンアップを行いました

TL;TD

  • バージョンアップはMacで行っています
  • 流れとしては以下となります
    • Vagrantのインストーラーをダウンロードし、インストールします

バージョンアップを行ってみます

現在のバージョンを確認する

$ vagrant version
Installed Version: 2.0.0
Latest Version: 2.2.3

To upgrade to the latest version, visit the downloads page and
download and install the latest version of Vagrant from the URL
below:

  https://www.vagrantup.com/downloads.html

If you're curious what changed in the latest release, view the
CHANGELOG below:

  https://github.com/mitchellh/vagrant/blob/v2.2.3/CHANGELOG.md

インストールされているバージョンと最新のバージョンに差異があります
Vagrantのサイトに行き、インストーラーをダウンロードします

ダウンロードしたインストーラーを実行し、バージョンを確認します

$ vagrant version
Vagrant failed to initialize at a very early stage:

The plugins failed to initialize correctly. This may be due to manual
modifications made within the Vagrant home directory. Vagrant can
attempt to automatically correct this issue by running:

  vagrant plugin repair

If Vagrant was recently updated, this error may be due to incompatible
versions of dependencies. To fix this problem please remove and re-install
all plugins. Vagrant can attempt to do this automatically by running:

  vagrant plugin expunge --reinstall

Or you may want to try updating the installed plugins to their latest
versions:

  vagrant plugin update

Error message given during initialization: Unable to resolve dependency: user requested 'vagrant-share (= 1.1.9)'

エラーにより、Vagrantの初期化に失敗しています。

エラーを解消します

エラーに出力されているコマンドを順番に実行していきます。

$ vagrant plugin repair
Repairing currently installed global plugins. This may take a few minutes...
Fetching: vagrant-share-1.1.9.gem (100%)
Fetching: micromachine-2.0.0.gem (100%)
Fetching: vagrant-vbguest-0.17.2.gem (100%)
Failed to automatically repair installed Vagrant plugins. To fix this
problem remove all user installed plugins and reinstall. Vagrant can
do this for you automatically by running the following command:

  vagrant plugin expunge --reinstall

Failure message received during repair:

Unable to resolve dependency: user requested 'vagrant-vbguest (= 0.14.2)'

「vagrant plugin repair」を実行するも、失敗します。

$ vagrant plugin expunge --reinstall

This command permanently deletes all currently installed user plugins. It
should only be used when a repair command is unable to properly fix the
system.

Continue? [N]: Y

All user installed plugins have been removed from this Vagrant environment!

Vagrant will now attempt to reinstall user plugins that were removed.
Installing the 'vagrant-share' plugin. This can take a few minutes...
Fetching: vagrant-share-1.1.9.gem (100%)
Fetching: micromachine-2.0.0.gem (100%)
Fetching: vagrant-vbguest-0.17.2.gem (100%)
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

Unable to resolve dependency: user requested 'vagrant-vbguest (= 0.14.2)'

「vagrant plugin expunge --reinstall」を実行するも、これまた失敗します。

$ vagrant plugin update
Updating installed plugins...
Updated 'vagrant-vbguest' to version '0.17.2'!

「vagrant plugin update」は成功しました。

最新になっているか、バージョンを確認します

$ vagrant version
Installed Version: 2.2.3
Latest Version: 2.2.3

You're running an up-to-date version of Vagrant!

現在のバージョンと最新のバージョンが一致しました。

おわりに

Vagrantのバージョンアップについてまとめました。
インストールしているプラグインは以下となります。
使用しているプラグインによって、スムーズにバージョンアップできないようなので、お困りの方は、参考にしてみてください

$ vagrant plugin list
vagrant-share (1.1.9, global)
  - Version Constraint: > 0
vagrant-vbguest (0.17.2, global)
  - Version Constraint: > 0
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3