LoginSignup
27
21

More than 5 years have passed since last update.

CentOS 5.x の yum update で Error: Cannot find a valid baseurl for repo: base エラー

Last updated at Posted at 2017-04-24

CentOS 5 は、2017/03/31 で EOL となったので、新しいアップデートは行われない。

[CentOS-announce] CentOS Linux 5 EOL

mirrorlist のサーバからは 5.x のツリーは削除されているので、yum による更新はエラーになる。

対処方法は、以下のいずれか。

1. CentOS 7 にアップデート

CentOS 7 にアップデートする。正攻法。

2. RedHat の拡張サポートを購入

REHL-5 の拡張サポートを購入する。
https://access.redhat.com/support/policy/updates/errata

3. yum の向き先を vault.centos.org に設定する

後ろ向きというか、意味は無いのだが、yum-cron などを仕掛けていて、とりあえずエラーを解消したい場合だけの対処療法。(もはや更新されないのだから、yum-cron 自体不要だが。)

yum の向き先を vault.centos.org に向けて、とりあえずエラーを凌ぐ。(追加リポジトリなどは、メンテナンスされていれば更新できる)このサーバは、アーカイブ用サーバなので対象パッケージが更新されることは無い。

/etc/yum.repos.d/CentOS-Base.repo を下記のように設定する。

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os # コメントアウト
baseurl=http://vault.centos.org/5.11/os/$basearch/ # vault.centos.org に設定
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates # コメントアウト
baseurl=http://vault.centos.org/5.11/updates/$basearch/ # vault.centos.org に設定
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras # コメントアウト
baseurl=http://vault.centos.org/5.11/extras/$basearch/ # vault.centos.org に設定
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
27
21
1

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
27
21