Metonymical Deflection

ゆるく日々のコト・たまにITインフラ

CentOS8 小ネタ集その5:リポジトリの設定

CentOS8のリポジトリ設定方法を記載します。

設定するリポジトリは以下の通りです。

基本編

  • epel-release
  • elrepo
  • remi
  • PowerTools

番外編

  • fed2el-release

1.OSインストール直後の状態

[root@c80gmas ~]# dnf repolist all                                                                                      
Last metadata expiration check: 0:00:12 ago on Fri 15 Nov 2019 03:44:42 AM JST.                                         
repo id                                         repo name                                                 status        
AppStream                                       CentOS-8 - AppStream                                      enabled: 5,089
AppStream-source                                CentOS-8 - AppStream Sources                              disabled      
BaseOS                                          CentOS-8 - Base                                           enabled: 2,843
BaseOS-source                                   CentOS-8 - BaseOS Sources                                 disabled      
PowerTools                                      CentOS-8 - PowerTools                                     disabled      
base-debuginfo                                  CentOS-8 - Debuginfo                                      disabled      
c8-media-AppStream                              CentOS-AppStream-8 - Media                                disabled      
c8-media-BaseOS                                 CentOS-BaseOS-8 - Media                                   disabled      
centosplus                                      CentOS-8 - Plus                                           disabled      
centosplus-source                               CentOS-8 - Plus Sources                                   disabled      
cr                                              CentOS-8 - cr                                             disabled      
extras                                          CentOS-8 - Extras                                         enabled:     3
extras-source                                   CentOS-8 - Extras Sources                                 disabled      
fasttrack                                       CentOS-8 - fasttrack                                      disabled      

2.epel-release

dnf -y install epel-release

5.PowerTools

PowerToolsはdevelなどが多く含まれており、ビルドをする際には何かと重宝します。
デフォルトでインストールされていますがDisbaleになっているため、Enableにしてしまいます。

sed -i -e s/enabled=0/enabled=1/g /etc/yum.repos.d/CentOS-PowerTools.repo

<出力例>

[root@c80gmas ~]# sed -i -e s/enabled=0/enabled=1/g /etc/yum.repos.d/CentOS-PowerTools.repo
[root@c80gmas ~]# cat /etc/yum.repos.d/CentOS-PowerTools.repo
# CentOS-PowerTools.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[PowerTools]
name=CentOS-$releasever - PowerTools
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=PowerTools&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/PowerTools/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

ここまでの設定で、以下のようにリポジトリが追加されていると思います。

[root@c80gmas ~]# dnf repolist all                                                                                      
Remi's Modular repository for Enterprise Linux 8 - x86_64                               109 kB/s | 509 kB     00:04     
Safe Remi's RPM repository for Enterprise Linux 8 - x86_64                              271 kB/s | 1.4 MB     00:05     
repo id                       repo name                                                                   status        
AppStream                     CentOS-8 - AppStream                                                        enabled: 5,089
AppStream-source              CentOS-8 - AppStream Sources                                                disabled      
BaseOS                        CentOS-8 - Base                                                             enabled: 2,843
BaseOS-source                 CentOS-8 - BaseOS Sources                                                   disabled      
PowerTools                    CentOS-8 - PowerTools                                                       enabled: 1,507
base-debuginfo                CentOS-8 - Debuginfo                                                        disabled      
c8-media-AppStream            CentOS-AppStream-8 - Media                                                  disabled      
c8-media-BaseOS               CentOS-BaseOS-8 - Media                                                     disabled      
centosplus                    CentOS-8 - Plus                                                             disabled      
centosplus-source             CentOS-8 - Plus Sources                                                     disabled      
cr                            CentOS-8 - cr                                                               disabled      
elrepo                        ELRepo.org Community Enterprise Linux Repository - el8                      enabled:    25
elrepo-extras                 ELRepo.org Community Enterprise Linux Extras Repository - el8               disabled      
elrepo-kernel                 ELRepo.org Community Enterprise Linux Kernel Repository - el8               disabled      
elrepo-testing                ELRepo.org Community Enterprise Linux Testing Repository - el8              disabled      
*epel                         Extra Packages for Enterprise Linux 8 - x86_64                              enabled: 3,153
epel-debuginfo                Extra Packages for Enterprise Linux 8 - x86_64 - Debug                      disabled      
epel-playground               Extra Packages for Enterprise Linux 8 - Playground - x86_64                 disabled      
epel-playground-debuginfo     Extra Packages for Enterprise Linux 8 - Playground - x86_64 - Debug         disabled      
epel-playground-source        Extra Packages for Enterprise Linux 8 - Playground - x86_64 - Source        disabled      
epel-source                   Extra Packages for Enterprise Linux 8 - x86_64 - Source                     disabled      
epel-testing                  Extra Packages for Enterprise Linux 8 - Testing - x86_64                    disabled      
epel-testing-debuginfo        Extra Packages for Enterprise Linux 8 - Testing - x86_64 - Debug            disabled      
epel-testing-source           Extra Packages for Enterprise Linux 8 - Testing - x86_64 - Source           disabled      
extras                        CentOS-8 - Extras                                                           enabled:     3
extras-source                 CentOS-8 - Extras Sources                                                   disabled      
fasttrack                     CentOS-8 - fasttrack                                                        disabled      
remi                          Remi's RPM repository for Enterprise Linux 8 - x86_64                       disabled      
remi-debuginfo                Remi's RPM repository for Enterprise Linux 8 - x86_64 - debuginfo           disabled      
remi-modular                  Remi's Modular repository for Enterprise Linux 8 - x86_64                   enabled:    12
remi-modular-test             Remi's Modular testing repository for Enterprise Linux 8 - x86_64           disabled      
remi-safe                     Safe Remi's RPM repository for Enterprise Linux 8 - x86_64                  enabled: 2,014
remi-safe-debuginfo           Remi's RPM repository for Enterprise Linux 8 - x86_64 - debuginfo           disabled      
remi-test                     Remi's test RPM repository for Enterprise Linux 8 - x86_64                  disabled      
remi-test-debuginfo           Remi's test RPM repository for Enterprise Linux 8 - x86_64 - debuginfo      disabled      

およそ1万超のパッケージが利用可能になっていると思います。

[root@c80gmas ~]# dnf list available | wc -l
11976

これから有用なパッケージが徐々に増えてくると思いますが、現段階において、これだけでは心許無いという方は以下も追加してみてください。

6.fed2el-release

fedora28のリポジトリを追加することにより、6万超のパッケージが利用可能になります。

dnf -y install https://extras.getpagespeed.com/release-el8-latest.rpm
dnf -y install fed2el-release

<追加後の状態>

[root@c80gmas ~]# dnf repolist all                                                                                      
Last metadata expiration check: 0:00:06 ago on Fri 15 Nov 2019 04:02:00 AM JST.                                         
repo id                                            repo name                                              status        
AppStream                                          CentOS-8 - AppStream                                   enabled: 5,089
AppStream-source                                   CentOS-8 - AppStream Sources                           disabled      
BaseOS                                             CentOS-8 - Base                                        enabled: 2,843
BaseOS-source                                      CentOS-8 - BaseOS Sources                              disabled      
PowerTools                                         CentOS-8 - PowerTools                                  disabled      
base-debuginfo                                     CentOS-8 - Debuginfo                                   disabled      
c8-media-AppStream                                 CentOS-AppStream-8 - Media                             disabled      
c8-media-BaseOS                                    CentOS-BaseOS-8 - Media                                disabled      
centosplus                                         CentOS-8 - Plus                                        disabled      
centosplus-source                                  CentOS-8 - Plus Sources                                disabled      
cr                                                 CentOS-8 - cr                                          disabled      
elrepo                                             ELRepo.org Community Enterprise Linux Repository - el8 enabled:    25
elrepo-extras                                      ELRepo.org Community Enterprise Linux Extras Repositor disabled      
elrepo-kernel                                      ELRepo.org Community Enterprise Linux Kernel Repositor disabled      
elrepo-testing                                     ELRepo.org Community Enterprise Linux Testing Reposito disabled      
*epel                                              Extra Packages for Enterprise Linux 8 - x86_64         enabled: 3,153
epel-debuginfo                                     Extra Packages for Enterprise Linux 8 - x86_64 - Debug disabled      
epel-playground                                    Extra Packages for Enterprise Linux 8 - Playground - x disabled      
epel-playground-debuginfo                          Extra Packages for Enterprise Linux 8 - Playground - x disabled      
epel-playground-source                             Extra Packages for Enterprise Linux 8 - Playground - x disabled      
epel-source                                        Extra Packages for Enterprise Linux 8 - x86_64 - Sourc disabled      
epel-testing                                       Extra Packages for Enterprise Linux 8 - Testing - x86_ disabled      
epel-testing-debuginfo                             Extra Packages for Enterprise Linux 8 - Testing - x86_ disabled      
epel-testing-source                                Extra Packages for Enterprise Linux 8 - Testing - x86_ disabled      
extras                                             CentOS-8 - Extras                                      enabled:     3
extras-source                                      CentOS-8 - Extras Sources                              disabled      
fasttrack                                          CentOS-8 - fasttrack                                   disabled      
fedora                                             Fedora 28 - x86_64                                     disabled      
fedora-debuginfo                                   Fedora 28 - x86_64 - Debug                             disabled      
fedora-rpmfusion-free                              RPM Fusion for Fedora 28 - Free                        disabled      
fedora-rpmfusion-free-debuginfo                    RPM Fusion for Fedora 28 - Free - Debug                disabled      
fedora-rpmfusion-free-source                       RPM Fusion for Fedora 28 - Free - Source               disabled      
fedora-rpmfusion-free-updates                      RPM Fusion for Fedora 28 - Free - Updates              disabled      
fedora-rpmfusion-free-updates-debuginfo            RPM Fusion for Fedora 28 - Free - Updates Debug        disabled      
fedora-rpmfusion-free-updates-source               RPM Fusion for Fedora 28 - Free - Updates Source       disabled      
fedora-rpmfusion-free-updates-testing              RPM Fusion for Fedora 28 - Free - Test Updates         disabled      
fedora-rpmfusion-free-updates-testing-debuginfo    RPM Fusion for Fedora 28 - Free - Test Updates Debug   disabled      
fedora-rpmfusion-free-updates-testing-source       RPM Fusion for Fedora 28 - Free - Test Updates Source  disabled      
fedora-rpmfusion-nonfree                           RPM Fusion for Fedora 28 - Nonfree                     disabled      
fedora-rpmfusion-nonfree-debuginfo                 RPM Fusion for Fedora 28 - Nonfree - Debug             disabled      
fedora-rpmfusion-nonfree-source                    RPM Fusion for Fedora 28 - Nonfree - Source            disabled      
fedora-rpmfusion-nonfree-updates                   RPM Fusion for Fedora 28 - Nonfree - Updates           disabled      
fedora-rpmfusion-nonfree-updates-debuginfo         RPM Fusion for Fedora 28 - Nonfree - Updates Debug     disabled      
fedora-rpmfusion-nonfree-updates-source            RPM Fusion for Fedora 28 - Nonfree - Updates Source    disabled      
fedora-rpmfusion-nonfree-updates-testing           RPM Fusion for Fedora 28 - Nonfree - Test Updates      disabled      
fedora-rpmfusion-nonfree-updates-testing-debuginfo RPM Fusion for Fedora 28 - Nonfree - Test Updates Debu disabled      
fedora-rpmfusion-nonfree-updates-testing-source    RPM Fusion for Fedora 28 - Nonfree - Test Updates Sour disabled      
fedora-russian-free                                Russian Fedora for Fedora 28 - Free                    disabled      
fedora-russian-free-debuginfo                      Russian Fedora for Fedora 28 - Free - Debug            disabled      
fedora-russian-free-source                         Russian Fedora for Fedora 28 - Free - Source           disabled      
fedora-russian-free-updates                        Russian Fedora for Fedora 28 - Free - Updates          disabled      
fedora-russian-free-updates-debuginfo              Russian Fedora for Fedora 28 - Free - Updates Debug    disabled      
fedora-russian-free-updates-source                 Russian Fedora for Fedora 28 - Free - Updates Source   disabled      
fedora-russian-nonfree                             Russian Fedora for Fedora 28 - Nonfree                 disabled      
fedora-russian-nonfree-debuginfo                   Russian Fedora for Fedora 28 - Nonfree - Debug         disabled      
fedora-russian-nonfree-source                      Russian Fedora for Fedora 28 - Nonfree - Source        disabled      
fedora-russian-nonfree-updates                     Russian Fedora for Fedora 28 - Nonfree - Updates       disabled      
fedora-russian-nonfree-updates-debuginfo           Russian Fedora for Fedora 28 - Nonfree - Updates Debug disabled      
fedora-russian-nonfree-updates-source              Russian Fedora for Fedora 28 - Nonfree - Updates Sourc disabled      
fedora-source                                      Fedora 28 - Source                                     disabled      
fedora-updates                                     Fedora 28 - x86_64 - Updates                           disabled      
fedora-updates-debuginfo                           Fedora 28 - x86_64 - Updates - Debug                   disabled      
fedora-updates-source                              Fedora 28 - Updates Source                             disabled      
getpagespeed-extras                                GetPageSpeed packages for Enterprise Linux 8 - x86_64  enabled:   369
getpagespeed-extras-mainline                       GetPageSpeed packages of mainline NGINX for Enterprise disabled      
getpagespeed-extras-nginx-mod                      GetPageSpeed packages with patched NGINX for Enterpris disabled      
getpagespeed-extras-noarch                         GetPageSpeed packages for Enterprise Linux 8 - noarch  enabled:    52
getpagespeed-extras-varnish60                      GetPageSpeed packages of Varnish 6.0.x for Enterprise  disabled      
remi                                               Remi's RPM repository for Enterprise Linux 8 - x86_64  disabled      
remi-debuginfo                                     Remi's RPM repository for Enterprise Linux 8 - x86_64  disabled      
remi-modular                                       Remi's Modular repository for Enterprise Linux 8 - x86 enabled:    12
remi-modular-test                                  Remi's Modular testing repository for Enterprise Linux disabled      
remi-safe                                          Safe Remi's RPM repository for Enterprise Linux 8 - x8 enabled: 2,014
remi-safe-debuginfo                                Remi's RPM repository for Enterprise Linux 8 - x86_64  disabled      
remi-test                                          Remi's test RPM repository for Enterprise Linux 8 - x8 disabled      
remi-test-debuginfo                                Remi's test RPM repository for Enterprise Linux 8 - x8 disabled      

これだけあれば一先ず困らないのでは?と思います。
ちなみに、fedora28のリポジトリを使用する場合、デフォルトでは全てDisbaleとなっており、これを全てEnableにするのはしんどいので、以下のようにdnfplusコマンドを使用してください。
<サンプル>

dnfplus -y install filezilla

これでも不足するようであれば、頑張ってビルドしましょう!

以上です。

7.最後に

以下のサイトを参考にさせて頂きました。
50k+ packages for RHEL 8 / CentOS 8, even before EPEL is up - GetPageSpeed
CentOS Repositories - pkgs.org

CentOS8は、まだ実用的ではない部分もありますが、少しづつでも使っていかないと勿体ないので慣れていきましょう。

私事ですが、ovsやovn、openstackなどが使えないと死活問題になるため、CentOS8への移行は少し躊躇っています。
ovsはビルドすればOKなのですが、ovs-dpdkの場合、--with-dpdkの後にmakeするとコケたりするので、ちょっと困っています。。