LoginSignup
1

More than 5 years have passed since last update.

vagrant up でマウントに失敗するが一応解決した

Posted at

現象

vagrant upを実施すると下記のエラー文言が表示される
どうやらVMは立ち上がっているようなのですが、mountに失敗している

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

yum install -y kernel-devel-`uname -r` gcc binutils make perl bzip2

Stdout from the command:

Loaded plugins: fastestmirror, versionlock
Setting up Install Process
Determining fastest mirrors
 * base: ftp.iij.ad.jp
 * epel: mirror01.idc.hinet.net
 * extras: ftp.iij.ad.jp
 * remi-safe: mirror.bebout.net
 * updates: ftp.iij.ad.jp


Stderr from the command:

/root/.bashrc: line 18: ./git-completion.bash: No such file or directory
Error: xz compression not available

ぐぐってみたところこの記事がいい感じに説明しているっぽい
https://centos.org/forums/viewtopic.php?t=61044

Error: xz compression not available.

上記のエラーはyumのリポジトリとCentOSのバージョンに差がある場合に発生するらしい。
CentOS7だとxz compressionをサポートしてるが、CentOS6ではそうではないのが原因らしい・・・

まずはvagrant sshで中にはいって現象を確認

$ cat /etc/redhat-release  #OSのバージョン確認
CentOS release 6.8 (Final)

$ rpm -qa | grep epel #リポジトリのバージョン確認
epel-release-7-9.noarch

ここ確認したところバージョンが違うね。。。
ここを参考に正しいバージョンを入れ直す

$ yum remove epel-release #yumのリポジトリを消す
$ rm -rf /var/cache/yum/x86_64/7/epel #キャッシュを消す

#64bit版CentOS 6のEPELリポジトリをインストール 自分のCentOSのバージョンにあったものを入れて下さい。
$ wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ sudo rpm -ivh epel-release-6-8.noarch.rpm
#確認
$ rpm -qa | grep epel
epel-release-6-8.noarch

直ったと思われるので
Vagrant reload!!!!!!!!!!!!

だめだ・・・・・がエラーが変わった

後はこの記事の⑤に沿って下記コマンドを実行して、
vagrant reloadしたら正常に立ち上がったー♪~(´ε` )

sudo yum install http://vault.centos.org/6.5/updates/x86_64/Packages/kernel-devel-2.6.32-431.3.1.el6.x86_64.rpm

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
1