Red Hat Enterprise Linux 7.9 DVDバージョンインストール後はrepolistが0件?

Linux Server

rhel-server-7.9-x86_64-dvd.isoでRed Hat Enterprise Linux 7.9を最小インストールしたときに基本登録されているRepositoryは、以下のように0件です。

$ yum repolist all
Loaded plugins: product-id, search-disabled-repos, subscription-manager
repolist: 0

PostgreSQLなどの追加ソフトウェアをインストールするには、OSインストールDVDメディアに含まれるRepositoryを登録する必要があります。 この記事ではOSインストールメディアのRepositoryを登録する方法を紹介します。

Red Hat Developerに個人開発者として登録すると、インターネットを経由するRed Hatのすべての配布版と最新のソフトウェアパッケージを利用することができます。 もし登録できる場合は、この記事をスキップして、以下の「RedHatパッケージリポジトリ(Repository)使用のためのSubscription Managerを登録」を参照してください。

Red Haterhel-7 パッケージストア(Repository)を使用するためのSubscription Manager登録
Red Hat Enterprise Linux 7におけるパッケージリポジトリの登録方法を詳しく解説します。Subscription Managerを通じて、Red Hatが提供するリポジトリを有効化し、最新のアップデートや追加パッケージをインストールする手順をご紹介。初心者でも簡単にフォローできる内容です。
Red Hat Enterprise Linux | Red Hat Developer
A stable, proven foundation that’s versatile enough for rolling out new applications, virtualizing environments, and cre...

DVDマウント

rhel-server-7.9-x86_64-dvd.isoを仮想マシン(VMwareなど)のに登録し、「/dev/cdrom」と認識させます。 その後、以下のコマンドでディレクトリ「/mnt/disc」にmountします。

$ su - root
Password: yourpassword
# mkdir -p /mnt/disc
# mount /dev/cdrom /mnt/disc
mount: /dev/sr0 is write-protected, mounting read-only

InstallMediaパッケージリポジトリ追加

mountしたフォルダからmedia.repoファイルを探して、「/etc/yum.repos.d/」フォルダにコピーします。 この操作により、Repositoryリストには表示されますが、まだ無効状態です。

# cp /mnt/disc/media.repo /etc/yum.repos.d/rhel7dvd.repo
# chmod 644 /etc/yum.repos.d/rhel7dvd.repo
# yum repolist all
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
repo id        repo name                     status
InstallMedia   Red Hat Enterprise Linux 7.9  disabled
repolist: 0

InstallMedia Repository 有効化

「rhel7dvd.repo」ファイルを開き、「gpgcheck」を0から1に変更し、「enabled=1」などを追加します。

# vi /etc/yum.repos.d/rhel7dvd.repo

修正前

[InstallMedia]
name=Red Hat Enterprise Linux 7.9
mediaid=1600369739.509793
metadata_expire=-1
gpgcheck=0
cost=500

修正後

[InstallMedia]
name=Red Hat Enterprise Linux 7.9
mediaid=1600369739.509793
metadata_expire=-1
gpgcheck=1
cost=500
enabled=1
baseurl=file:///mnt/disc/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

yum clean all」コマンドでキャッシュを消去し、InstallMedia(DVDリポジトリ)からパッケージリストを取得できるかどうかを確認します。

# yum clean all
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Cleaning repos: InstallMedia

# yum repolist all
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
InstallMedia                 | 2.8 kB  00:00:00
(1/2): InstallMedia/group    | 628 kB  00:00:00
(2/2): InstallMedia/primary  | 2.1 MB  00:00:00
InstallMedia              5230/5230
repo id         repo name                       status
InstallMedia    Red Hat Enterprise Linux 7.9   enabled: 5,230
repolist: 5,230

利用可能なソフトウェア(例:PostgreSQL)確認

# yum list postgresql
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Available Packages
postgresql.i686    9.2.24-4.el7_8  InstallMedia
postgresql.x86_64  9.2.24-4.el7_8  InstallMedia

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