提供:すだちWiki
移動先: 案内検索

dnf用リポジトリ追加(AlmaLinux9)

メインページ > Category:自宅サーバー > AlmaLinux 9 で自宅サーバー構築  > dnf用リポジトリ追加(AlmaLinux9)

標準リポジトリで提供されないパッケージをdnfでインストールできるようにする。

EPELリポジトリ導入(EPEL)

Fedoraプロジェクトが提供するRHEL用にビルドされたスペシャルパッケージを 配布するEPELを追加してきます。

[root@host2 ~]# dnf -y install epel-release

※他リポジトリとのパッケージの競合をさけるため、enabled=0 として普段は読まないようにしておく

[root@host2 ~]# vi /etc/yum.repos.d/epel.repo

[epel]
name=Extra Packages for Enterprise Linux $releasever - $basearch
#baseurl=https://download.fedoraproject.org/pub/epel/$releasever/Everything/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
# [enabled=1] = リポジトリ有効, [enabled=0] = リポジトリ無効
enabled=0
# [priority=*] を追記することで優先度を指定可
# 1-99 を指定可, 1 が最優先, 未指定の場合のデフォルトは 99
priority=10
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever

.....
.....

上記リポジトリを使用してインストールする場合は、以下のようにコマンド入力

[root@host4 ~]# dnf --enablerepo=epel install [パッケージ名]