概要
ALmalinaxのサーバを、バージョンを下げたいとなった時に使用する手順。
具体的には、以下のコマンドを実行する。
sudo dnf --releasever=9.2 downgrade redhat-release
自分が実行した環境だと、epelの部分で読み込めなくなるエラーが発生した。
[username@servername ~]$
[username@servername ~]$ sudo dnf --releasever=9.2 --exclude=epel downgrade redhat-release
Extra Packages for Enterprise Linux 9.2 - x86_64 25 kB/s | 116 kB 00:04
Errors during downloading metadata for repository 'epel':
- Status code: 404 for https://mirrors.fedoraproject.org/metalink?repo=epel-9.2&arch=x86_64&infra=$infra&content=$contentdir (IP: 67.219.144.68)
- Status code: 404 for https://mirrors.fedoraproject.org/metalink?repo=epel-9.2&arch=x86_64&infra=$infra&content=$contentdir (IP: 34.221.3.152)
エラー: repo 'epel' のメタデータのダウンロードに失敗しました : Cannot prepare internal mirrorlist: Status code: 404 for https://mirrors.fedoraproject.org/metalink?repo=epel-9.2&arch=x86_64&infra=$infra&content=$contentdir (IP: 67.219.144.68)
[username@servername ~]$ sudo su
そのため、以下のようにリポジトリを削除する。
[root@servername home]# cd /etc/yum.repos.d/
[root@servername yum.repos.d]# ls
almalinux-appstream.repo almalinux-highavailability.repo almalinux-rt.repo epel.repo
almalinux-baseos.repo almalinux-nfv.repo almalinux-sap.repo zabbix.repo
almalinux-crb.repo almalinux-plus.repo almalinux-saphana.repo
almalinux-extras.repo almalinux-resilientstorage.repo epel-testing.repo
[root@servername yum.repos.d]# rm epel.repo
rm: 通常ファイル 'epel.repo' を削除しますか? yes
[root@servername yum.repos.d]#
その後実行すると、以下のように出力される。
username@servername ~]$ sudo dnf --releasever=9.2 --exclude=epel downgrade redhat-release
メタデータの期限切れの最終確認: 0:19:55 前の 2024年01月25日 12時39分05秒 に実施しました。
依存関係が解決しました。
========================================================================================================================
パッケージ アーキテクチャー バージョン リポジトリー サイズ
========================================================================================================================
ダウングレード:
almalinux-gpg-keys x86_64 9.2-1.el9 baseos 9.6 k
almalinux-release x86_64 9.2-1.el9 baseos 20 k
almalinux-repos x86_64 9.2-1.el9 baseos 9.8 k
トランザクションの概要
========================================================================================================================
ダウングレード 3 パッケージ
この状態でOSのバージョンを確認してみると、戻っているのが確認できる。
[username@servername ~]$ cat /etc/redhat-release
AlmaLinux release 9.2 (Turquoise Kodkod)
終わったら、入れる前に消していたepelも再度インストールしよう。(最初からないなら不要)
sudo dnf -y install epel-release
参考サイト
yumで、各種パッケージを落としたいなら以下。