Alma Linux サーバー構築②

  • このエントリーをはてなブックマークに追加

certbot をインストールする

# sudo dnf install -y certbot python3-certbot-nginx
Last metadata expiration check: 0:08:36 ago on Tue 25 Mar 2025 03:25:27 AM JST.

No match for argument: certbot
No match for argument: python3-certbot-nginx
Error: Unable to find a match: certbot python3-certbot-nginx


おっと💦
certbot や python3-certbot-nginx が dnf で見つからない場合、EPEL(Extra Packages for Enterprise Linux)リポジトリを有効にする必要があります。

1. EPEL リポジトリの有効化

まず、EPEL リポジトリをインストールします。

#sudo dnf install -y epel-release

次に、EPEL のリポジトリが正しく追加されているか確認 します。
#sudo dnf repolist

2. Snapd のインストール

AlmaLinux では、最新の certbotsnapd を利用してインストールするのが推奨されています。
#sudo dnf install -y snapd

Snapd を有効化し、起動します。
#sudo systemctl enable --now snapd.socket

シンボリックリンクを作成(必要な場合)
bashコピーする編集するsudo ln -s /var/lib/snapd/snap /snap

3. certbot のインストール

Snap を最新状態に更新し、certbot をインストールします。

#sudo snap install core
#sudo snap refresh core
#sudo snap install --classic certbot

#systemctl status snapd
と、ここで
Active: inactive (dead)
おっと💦

#snap list
No snaps are installed yet. Try ‘snap install hello-world’.
と言われたので
# snap install hello-world
# snap list
Name Version Rev Tracking Publisher Notes
core 16-2.61.4-20240607 17200 latest/stable canonical✓ core
hello-world 6.4 29 latest/stable canonical✓ –
snapd 2.67.1 23771 latest/stable canonical✓ snapd
# sudo snap refresh core
snap “core” has no updates available
# sudo snap install –classic certbot
error: cannot install “certbot”: classic confinement requires snaps under /snap
or symlink from /snap to /var/lib/snapd/snap
おやおや…💦
# sudo ln -s /var/lib/snapd/snap /snap
# sudo systemctl restart snapd
active (running)
よしよし✨
# systemctl status snapd
# sudo snap refresh core
snap “core” has no updates available
# sudo snap install –classic certbot
certbot 3.3.0 from Certbot Project (certbot-eff✓) installed
# sudo ln -s /snap/bin/certbot /usr/bin/certbot
# certbot –version
certbot 3.3.0


  • このエントリーをはてなブックマークに追加

SNSでもご購読できます。

コメントを残す

*