2021年暮れの CentOS6.6アップグレード作業

今更ながら CentOS 6.6 のアップグレード。すでに CentOS 6 系のサポートは 2020年11月30日でサポートが終了しているが、なんか手元に残っていたのでアップグレードをしてみた。

[root@hoge ~]# yum check-update
読み込んだプラグイン:fastestmirror, security
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
エラー: Cannot find a valid baseurl for repo: base

当然のことながらできない。

[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-6

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

mirrorlist をコメントアウトして、baseurl のコメントを外して、http://mirror.centos.orghttps://vault.centos.org/ に変更する。
とりあえず、CentOS-Base.repo の base と updates 以外の項目は enable=0 にして無効にする。

[root@hoge yum.repos.d]# yum check-update
読み込んだプラグイン:fastestmirror, security
Determining fastest mirrors
 * rpmforge: mirrors.netix.net
https://vault.centos.org/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection

SSLでエラーがでる。証明書が古いので証明書を更新する。

適当なディレクトリに移動して、証明書をダウンロードして rpm でインストール。

[root@hgoe src]# wget --no-check-certificate https://vault.centos.org/6.10/updates/x86_64/Packages/ca-certificates-2020.2.41-65.1.el6_10.noarch.rpm
[root@hoge src]# rpm -Uhv  ca-certificates-2020.2.41-65.1.el6_10.noarch.rpm

他に P11-kit や nss、Openssl などのパッケージが必要になるかもしれないので必要に応じて vault あたりからダウンロードして、rpm でインストールする。

[root@hoge yum.repos.d]# yum check-update
読み込んだプラグイン:fastestmirror
Determining fastest mirrors
base                                                     | 3.7 kB     00:00
base/primary_db                                          | 4.7 MB     00:03

エラーが出なくなったので、アップグレードを行う。

[root@hoge yum.repos.d]# yum update -y
reboot
[root@hoge ~]# cat /etc/redhat-release
CentOS release 6.10 (Final)

6.10 にアップグレードされた。