azure

Azure VMのRHEL9.0でEPELとcertbotインストールするの巻

Azure VM の RHEL9.0 の SSH 接続

いつものように Tera Term で接続しようとするも何故か繋がらない。

Windows コマンドプロンプトの標準搭載 ssh コマンドで接続できたのでこちらを使う。

C:\Users\test> ssh -i Downloads\test_key.pem azureuser@X.X.X.X
The authenticity of host 'X.X.X.X (X.X.X.X)' can't be established.
ED25519 key fingerprint is SHA256:Uyka+fk*********************************.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'X.X.X.X' (ED25519) to the list of known hosts.
Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
[azureuser@testvm ~]$

IPv6 無効化

気になるので無効化。

[root@testvm ~]# nmcli con mod eth0 ipv6.method "disabled"
[root@testvm ~]# nmcli con up eth0

EPEL release をインストール

dnf install epel-release が効かない。んならばー rpm で直接インストールしかないのだ。

[root@testvm ~]# dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

certbot をインストール

やってみる。

[root@testvm ~]# dnf -y install certbot
Extra Packages for Enterprise Linux 9.0 - x86_64                                         15 kB/s |  98 kB     00:06
Errors during downloading metadata for repository 'epel':
  - Status code: 404 for https://mirrors.fedoraproject.org/metalink?repo=epel-9.0&arch=x86_64&infra=$infra&content=$contentdir (IP: 67.219.144.68)
  - Status code: 404 for https://mirrors.fedoraproject.org/metalink?repo=epel-9.0&arch=x86_64&infra=$infra&content=$contentdir (IP: 152.19.134.142)
  - Status code: 404 for https://mirrors.fedoraproject.org/metalink?repo=epel-9.0&arch=x86_64&infra=$infra&content=$contentdir (IP: 209.132.190.2)
Error: Failed to download metadata for repo 'epel': Cannot prepare internal mirrorlist: Status code: 404 for https://mirrors.fedoraproject.org/metalink?repo=epel-9.0&arch=x86_64&infra=$infra&content=$contentdir (IP: 152.19.134.142)

ミラーサイトが見つからない、だと。どうかしてるぜ。

よく見てみると、本家だと releasever=9 であるのに、この Azure VM では releasever=9.0 にロックしている。

[root@testvm ~]# cat /etc/yum/vars/releasever
9.0

じゃあ releasever を 9 に指定しなおせばええんやな。--releasever=9 を指定するも今度は microsoft のリポジトリが見つからなくなる、だと。

[root@testvm ~]# dnf -y install certbot --releasever=9
Extra Packages for Enterprise Linux 9 - x86_64                                          3.4 MB/s |  12 MB     00:03
Red Hat Enterprise Linux 9 for x86_64 - AppStream - Extended Update Support from RHUI (  13  B/s |  14  B     00:01
Errors during downloading metadata for repository 'rhel-9-for-x86_64-appstream-eus-rhui-rpms':
  - Status code: 404 for https://rhui4-1.microsoft.com/pulp/content/content/eus/rhel9/rhui/9/x86_64/appstream/os/repodata/repomd.xml (IP: 20.24.186.80)
Error: Failed to download metadata for repo 'rhel-9-for-x86_64-appstream-eus-rhui-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

こうなるともう直接編集。/etc/yum.repos.d/epel.repo の $releasever を 9 に変換しちゃいます。

[root@testvm ~]# sed -i -e 's/$releasever/9/g' /etc/yum.repos.d/epel.repo

これで dnf -y install certbot ができた。こんなんでええのやろか。

コメント

タイトルとURLをコピーしました