2020/09/28追記
Oracle公式のCentOSからの移行手順「Switch your CentOS systems to Oracle Linux」とRHELからサポートありのOracleLinuxへの移行手順「Switching from Red Hat Network (RHN) to Oracle Unbreakable Linux Network (ULN)」
また、逆にRedHat公式によるCentOS/Oracle LinuxからRHELへの移行手順「How to convert from CentOS or Oracle Linux to RHEL」
また、レポジトリによっては下記の様なメッセージが出るようになったようです。
IMPORTANT: A legacy Oracle Linux yum server repo file was found. Oracle Linux yum server repository configurations have changed which means public-yum-ol7.repo will no longer be updated. New repository configuration files have been installed but are disabled. To complete the transition, run this script as the root user: /usr/bin/ol_yum_configure.sh See https://yum.oracle.com/faq.html for more information.
Oracle Linux用にOpenStackがリリースされた、ということなので、Oracle Linuxの環境を用意してみようと思った。
つい先ほど、RHEL4/CentOS4でOralce Linuxにしてみたので、同じようにできるかな、と思ったらちょっと工夫が必要でした。
(注:手法としては、既知のディストリビューション乗り換え手法なんですけどね)
1. GPG Keyの入手
[root@centos6 ~]# wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle<br> --2014-09-26 16:40:22-- http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6<br> public-yum.oracle.com をDNSに問いあわせています... 203.179.83.11, 203.179.83.19<br> public-yum.oracle.com|203.179.83.11|:80 に接続しています... 接続しました。<br> HTTP による接続要求を送信しました、応答を待っています... 200 OK<br> 長さ: 1011 <br> `/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle' に保存中</p> <p>100%[===================================================>] 1,011 --.-K/s 時間 0s</p> <p>2014-09-26 16:40:22 (4.83 MB/s) - `/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle' へ保存完了 [1011/1011]</p> <p>[root@centos6 ~]#
2. yumレポジトリの編集
Oracle Linux用レポジトリの追加と、CentOS用レポジトリの削除
[root@centos6 ~]# cd /etc/yum.repos.d<br> [root@centos6 yum.repos.d]# wget http://public-yum.oracle.com/public-yum-ol6.repo<br> --2014-09-26 16:40:45-- http://public-yum.oracle.com/public-yum-ol6.repo<br> public-yum.oracle.com をDNSに問いあわせています... 203.179.83.11, 203.179.83.19<br> public-yum.oracle.com|203.179.83.11|:80 に接続しています... 接続しました。<br> HTTP による接続要求を送信しました、応答を待っています... 200 OK<br> 長さ: 4233 (4.1K) <br> `public-yum-ol6.repo' に保存中</p> <p>100%[===================================================>] 4,233 --.-K/s 時間 0s</p> <p>2014-09-26 16:40:46 (323 MB/s) - `public-yum-ol6.repo' へ保存完了 [4233/4233]</p> <p>[root@centos6 yum.repos.d]# ls<br> CentOS-Base.repo CentOS-Media.repo public-yum-ol6.repo<br> CentOS-Debuginfo.repo CentOS-Vault.repo<br> [root@centos6 yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.disable<br> [root@centos6 yum.repos.d]# mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.disable<br> [root@centos6 yum.repos.d]# mv CentOS-Media.repo CentOS-Media.repo.disable<br> [root@centos6 yum.repos.d]# mv CentOS-Vault.repo CentOS-Vault.repo.disable<br> [root@centos6 yum.repos.d]#
で、アップデート実施
[root@centos6 yum.repos.d]# yum update -y<br> Loaded plugins: fastestmirror<br> Loading mirror speeds from cached hostfile<br> Setting up Update Process<br> Resolving Dependencies<br> --> Running transaction check<br> ---> Package audit.x86_64 0:2.2-2.el6 will be updated<br> <略><br> Transaction Check Error:<br> file /etc/issue from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64<br> file /etc/issue.net from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64<br> file /etc/redhat-release from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64<br> file /etc/rpm/macros.dist from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64<br> file /etc/system-release from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64<br> file /etc/system-release-cpe from install of oraclelinux-release-6:6Server-5.0.2.x86_64 conflicts with file from package centos-release-6-4.el6.centos.10.x86_64</p> <p>Error Summary<br> -------------</p> <p>[root@centos6 yum.repos.d]#
oraclelinux-releaseパッケージと、centos-releaseパッケージが競合するというもの。
/var/cache/yum/x86_64/6/ol6_latest/packages/に、oraclelinux-releaseパッケージがダウンロードされているので、rpmコマンドを使って強制的にインストールする。
[root@centos6 yum.repos.d]# rpm -Uvh --force /var/cache/yum/x86_64/6/ol6_latest/packages/oraclelinux-release-6Server-5.0.2.x86_64.rpm /var/cache/yum/x86_64/6/ol6_latest/packages/redhat-release-server-6Server-6.5.0.1.0.1.el6.x86_64.rpm<br> 準備中... ########################################### [100%]<br> 1:redhat-release-server ########################################### [ 50%]<br> 2:oraclelinux-release ########################################### [100%]<br> [root@centos6 yum.repos.d]#
これで「yum update」が可能になりました。
再起動後は以下の様な状態となりました。
[root@centos6 ~]# uname -a<br> Linux centos6.lab.dtc.co.jp 2.6.32-431.29.2.el6.x86_64 #1 SMP Tue Sep 9 11:28:47 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux<br> [root@centos6 ~]# rpm -qa|grep release<br> redhat-release-server-6Server-6.5.0.1.0.1.el6.x86_64<br> centos-release-6-4.el6.centos.10.x86_64<br> oraclelinux-release-6Server-5.0.2.x86_64<br> [root@centos6 ~]# cat /etc/motd<br> [root@centos6 ~]# cat /etc/redhat-release<br> Red Hat Enterprise Linux Server release 6.5 (Santiago)<br> [root@centos6 ~]#
ちなみに、Oracle Linux 6では、以下の追加レポジトリがある。
・MySQL 5.5 (ol6_MySQL)
・MySQL 5.6 (ol6_MySQL56)
・Unbrakable Enterprise kernel 2.6.39 (ol6_UEK_latest)
・Unbrakable Enterprise kernel 3.8.13 (ol6_UEKR3_latest)
・常に最新kernel。 (ol6_playground_latest)
詳細については、以前書いた「Oracle Linux用の公開レポジトリについて」を参照のこと。
“RHEL6/CentOS6をOracle Linuxにしてみる” への1件の返信