yum update で「Cannot find a valid baseurl for repo: base」 エラーが出た場合の対処方法

yum update で「Cannot find a valid baseurl for repo: base」 エラーが出た場合の対処方法の画像

yum update をしたら、以下のようなエラーが出た。

エラー: Cannot find a valid baseurl for repo: base
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was
12: Timeout on http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock: (28, 'connect() timed out!')

なんかmirrorlist.centos.orgに接続できないっぽいので、RPMパッケージをダウンロードしにいく先をミラーサイトではなく理研へと変更した。
編集するファイルは以下となる。

# vi /etc/yum.repos.d/CentOS-Base.repo

ファイルを開き、ミラーリストをコメントアウトして新たに理研のサイトをbaseurlに追加する。
※以下は変更箇所だけ抜粋して記載しています。

[base]
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/os/$basearch/

[updates]
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/updates/$basearch/

[extras]
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/extras/$basearch/

[centosplus]
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/centosplus/$basearch/

[contrib]
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/contrib/$basearch/