Windows環境でVagrantをイントールして動かしたところ、
yumができませんでした。
インストールからcentosへのログインまでは、
この記事を参照されせていただきました。
Windows上でVirtualBox+Vagrant+CentOSによる仮想環境構築
それでyumインストールしたところこんなエラーが。。
[root@localhost ~]# yum -y install httpd
Geladene Plugins: fastestmirror
base | 3.6 kB 00:00:00
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
14: curl#52 - "Empty reply from server"
どうやらyumのリポジトリに記載されているURLがダメらしい。
/etc/yum.repos.d/CentOS-Base.repo の mirrorlistがダメらしい。
そこでmirrorlistをコメントアウトして、
baseurlのコメントアウトを外したらyumが実行できた。
Befor
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
After
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7