概要
ローカルリポジトリを使用する際に作成するrepoの記載方法がRHEL7とRHEL8とで異なっているため、それぞれの違いを記載する。
(CentOSやOracle Linuxにおいても同様の差異があります。)
OS
Red Hat Enterprise Linux 7.6
Red Hat Enterprise Linux 8.6
設定内容
RHEL7の設定内容
■ローカルリポジトリ(/etc/yum.repos.d/local.repo)
[local]
name=localrepo
enabled=1
gpgcheck=0
baseurl=file:///mnt
■isoメディア
ls -l
合計 974
dr-xr-xr-x 3 root root 2048 9月 18 2020 EFI
-r--r--r-- 1 root root 8266 9月 18 2020 EULA
-r--r--r-- 1 root root 18092 9月 18 2020 GPL
dr-xr-xr-x 2 root root 2048 9月 18 2020 LiveOS
dr-xr-xr-x 2 root root 946176 9月 18 2020 Packages
-r--r--r-- 1 root root 3375 7月 14 2020 RPM-GPG-KEY-redhat-beta
-r--r--r-- 1 root root 3211 7月 14 2020 RPM-GPG-KEY-redhat-release
-r--r--r-- 1 root root 1796 9月 18 2020 TRANS.TBL
dr-xr-xr-x 4 root root 2048 9月 18 2020 addons
-r--r--r-- 1 root root 1455 9月 18 2020 extra_files.json
dr-xr-xr-x 3 root root 2048 9月 18 2020 images
dr-xr-xr-x 2 root root 2048 9月 18 2020 isolinux
-r--r--r-- 1 root root 114 9月 18 2020 media.repo
dr-xr-xr-x 2 root root 2048 9月 18 2020 repodata
RHEL8の設定内容
■ローカルリポジトリ(/etc/yum.repos.d/local.repo)
[InstallMedia-BaseOS]
name=Red Hat Enterprise Linux 8 - BaseOS
metadata_expire=-1
gpgcheck=0
enabled=1
baseurl=file:///mnt/BaseOS/
[InstallMedia-AppStream]
name=Red Hat Enterprise Linux 8 - AppStream
metadata_expire=-1
gpgcheck=0
enabled=1
baseurl=file:///mnt/AppStream/
■isoメディア
ls -l
合計 48
dr-xr-xr-x. 4 root root 2048 4月 21 01:40 AppStream
dr-xr-xr-x. 4 root root 2048 4月 21 01:40 BaseOS
dr-xr-xr-x. 3 root root 2048 4月 21 01:40 EFI
-r--r--r--. 1 root root 8154 4月 21 01:39 EULA
-r--r--r--. 1 root root 18092 4月 21 01:39 GPL
-r--r--r--. 1 root root 1669 4月 21 01:39 RPM-GPG-KEY-redhat-beta
-r--r--r--. 1 root root 5135 4月 21 01:38 RPM-GPG-KEY-redhat-release
-r--r--r--. 1 root root 1796 4月 21 01:40 TRANS.TBL
-r--r--r--. 1 root root 1455 4月 21 01:39 extra_files.json
dr-xr-xr-x. 3 root root 2048 4月 21 01:40 images
dr-xr-xr-x. 2 root root 2048 4月 21 01:40 isolinux
-r--r--r--. 1 root root 103 4月 21 01:38 media.repo
pwd
/mnt/AppStream
ls -l
合計 1234
dr-xr-xr-x. 2 root root 1259520 4月 21 01:40 Packages
dr-xr-xr-x. 2 root root 4096 4月 21 01:40 repodata
pwd
/mnt/BaseOS
ls -l
合計 304
dr-xr-xr-x. 2 root root 309248 4月 21 01:40 Packages
dr-xr-xr-x. 2 root root 2048 4月 21 01:40 repodata
差異
baseurlが異なっており、RHEL7用ローカルリポジトリでyumを実行しようとすると失敗します。
以上、知っておくと少しだけ役に立つ知識でした。