|
カテゴリ:PC関連
古いバージョンのLinuxサーバをメンテすることが多くなったので、 いつも試行錯誤するyumのリポジトリの設定をメモっておきました。 --------------------------- 古いバージョンのRedHatで、yum コマンドを実行すると、次のようなエラーになります。 例:RedHat 5.4(64bit)の場合 yum update Loaded plugins: security YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. 5Server is not a valid release or hasnt been released yet/ removing mirrorlist with no valid mirrors: /var/cache/yum/local/mirrorlist.txt Error: Cannot retrieve repository metadata (repomd.xml) for repository: local. Please verify its path and try again EOSLになっている古いバージョンは、ミラーから削除されるため、yumコマンドはエラーになります。 RedHatのリポジトリには、古いバージョンはないので、CentOSのリポジトリを使います。 下記で、古いリポジトリを参照できます。(2019年4月時点) そこで、以下のようなrepoファイルを作成すれば、参照できるようになります。 /etc/yum.repos.d/CentOS-Base.repo [root yum.repos.d]# cat CentOS-Base.repo [base] name=CentOS-$releasever - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ baseurl=http://vault.centos.org/5.4/os/$basearch/ gpgcheck=1 #gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-$releasever gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5 [updates] name=CentOS-$releasever - Updates #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ baseurl=http://vault.centos.org/5.4/os/$basearch/ gpgcheck=1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5 [extras] name=CentOS-$releasever - Extras #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ baseurl=http://vault.centos.org/5.4/os/$basearch/ gpgcheck=1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5 このファイルを作成したあとで、 リポジトリのlistを確認すると、ちゃんと認識してくれました。 [root yum.repos.d]# yum repolist Loaded plugins: security repo id repo name status base CentOS-5Server - Base enabled: 2,535 extras CentOS-5Server - Extras enabled: 2,535 updates CentOS-5Server - Updates enabled: 2,535 zabbix Zabbix Official Repository - x86_64 enabled: 401 zabbix-non-supported Zabbix Official Repository non-supported - x86_64 enabled: 13 repolist: 8,019 コメントアウトした行は、参考のために残してありますが、 変数のままだと、必要な環境を指してくれないので、明示的に変更します。 $releaseverの変数のままだと、この環境では、 "5Server" になってしまうので、明示的に指定しました。 上記の設定では、バージョンを5.4と固定しています。 $basearchの変数は、環境のアーキテクチャに合わせて決まるので、 この5.4(64bit)の場合だと、x86_64と、i386 を探してくれます。
環境にあわせて、i686も探すので、この変数は書き換える必要はないはずです。 お気に入りの記事を「いいね!」で応援しよう
Last updated
2019.04.09 03:37:18
コメント(0) | コメントを書く
[PC関連] カテゴリの最新記事
|