1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RHEL8 で dnf 使用するまで

Last updated at Posted at 2019-11-11

環境

# uname -a
Linux RHEL8.localdomain 4.18.0-80.el8.x86_64 #1 SMP Wed Mar 13 12:02:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
# rpm -q dnf
dnf-4.0.9.2-5.el8.noarch
# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.0 (Ootpa)

1.システムの登録およびサブスクリプション

RHEL8 でも手順は以下と同じ。

Red Hat Subscription Management でシステムの登録、サブスクライブするまで
https://qiita.com/hijiri0404/items/126958ba7535c36db0f4

2.dnf の実行

あとは、以下のドキュメントなどを参考に yum と比較しながら実行すれば、使い勝手がわかるかなと。

Changes in DNF CLI compared to YUM
https://dnf.readthedocs.io/en/latest/cli_vs_yum.html

update などは一緒だが、以下のように yum と書式が異なるものも存在する。

# dnf repoquery --deplist vsftpd
Updating Subscription Management repositories.
メタデータの期限切れの最終確認: 0:15:48 時間前の 2019年11月11日 22時54分27秒 に実施しました。
package: vsftpd-3.0.3-28.el8.x86_64
  dependency: /bin/bash
   provider: bash-4.4.19-10.el8.x86_64
  dependency: /bin/sh
   provider: bash-4.4.19-10.el8.x86_64
  dependency: libc.so.6()(64bit)
   provider: glibc-2.28-72.el8.x86_64
  dependency: libc.so.6(GLIBC_2.14)(64bit)
   provider: glibc-2.28-72.el8.x86_64
  dependency: libc.so.6(GLIBC_2.15)(64bit)
   provider: glibc-2.28-72.el8.x86_64
  dependency: libc.so.6(GLIBC_2.2.5)(64bit)
   provider: glibc-2.28-72.el8.x86_64
  dependency: libc.so.6(GLIBC_2.28)(64bit)
   provider: glibc-2.28-72.el8.x86_64
  dependency: libc.so.6(GLIBC_2.3)(64bit)
   provider: glibc-2.28-72.el8.x86_64
  dependency: libc.so.6(GLIBC_2.3.4)(64bit)
   provider: glibc-2.28-72.el8.x86_64
  dependency: libc.so.6(GLIBC_2.4)(64bit)
   provider: glibc-2.28-72.el8.x86_64
  dependency: libc.so.6(GLIBC_2.7)(64bit)
   provider: glibc-2.28-72.el8.x86_64
  dependency: libcap.so.2()(64bit)
   provider: libcap-2.26-1.el8.x86_64
  dependency: libcrypto.so.1.1()(64bit)
   provider: openssl-libs-1:1.1.1c-2.el8.x86_64
  dependency: libcrypto.so.1.1(OPENSSL_1_1_0)(64bit)
   provider: openssl-libs-1:1.1.1c-2.el8.x86_64
  dependency: libdl.so.2()(64bit)
   provider: glibc-2.28-72.el8.x86_64
  dependency: libpam.so.0()(64bit)
   provider: pam-1.3.1-4.el8.x86_64
  dependency: libpam.so.0(LIBPAM_1.0)(64bit)
   provider: pam-1.3.1-4.el8.x86_64
  dependency: libssl.so.1.1()(64bit)
   provider: openssl-libs-1:1.1.1c-2.el8.x86_64
  dependency: libssl.so.1.1(OPENSSL_1_1_0)(64bit)
   provider: openssl-libs-1:1.1.1c-2.el8.x86_64
  dependency: logrotate
   provider: logrotate-3.14.0-3.el8.x86_64
  dependency: rtld(GNU_HASH)
   provider: glibc-2.28-72.el8.x86_64
   provider: glibc-2.28-72.el8.i686
#
# dnf download vsftpd
Updating Subscription Management repositories.
メタデータの期限切れの最終確認: 0:07:57 時間前の 2019年11月11日 22時54分27秒 に実施しました。
vsftpd-3.0.3-28.el8.x86_64.rpm                                                                                               109 kB/s | 180 kB     00:01
#
# dnf download vsftpd --source
Updating Subscription Management repositories.
rhel-8-for-x86_64-appstream-source-rpms リポジトリーの有効化
rhel-8-for-x86_64-baseos-source-rpms リポジトリーの有効化
メタデータの期限切れの最終確認: 0:02:03 時間前の 2019年11月11日 23時00分30秒 に実施しました。
vsftpd-3.0.3-28.el8.src.rpm                                                                                                   99 kB/s | 293 kB     00:02
#
# dnf download vsftpd --debuginfo
Updating Subscription Management repositories.
rhel-8-for-x86_64-appstream-debug-rpms リポジトリーの有効化
rhel-8-for-x86_64-baseos-debug-rpms リポジトリーの有効化
メタデータの期限切れの最終確認: 0:01:34 時間前の 2019年11月11日 23時01分13秒 に実施しました。
vsftpd-debuginfo-3.0.3-28.el8.x86_64.rpm                                                                                      75 kB/s | 208 kB     00:02

3.インストール用の DVD を使用した dnf

DVD を適当にマウントし (以下は /media にマウントした場合)、/etc/yum.repos.d に以下のようなファイルを作成するだけ。

/etc/yum.repos.d/rhel8.repo
[InstallMedia-BaseOs]
name=Red Hat Enterprise Linux 8.0.0-BaseOs
mediaid=None
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///media/BaseOS
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[InstallMedia-AppStream]
name=Red Hat Enterprise Linux 8.0.0-AppStream
mediaid=None
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///media/AppStream
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

以下が参考になる。

Need to set up yum repository for locally-mounted DVD on Red Hat Enterprise Linux 8
https://access.redhat.com/solutions/4342751

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?