RHELでコマンドが含まれるパッケージを探してインストールする!

RHELでコマンドが含まれるパッケージを探して、コマンドをインストールします。

コマンドが含まれるパッケージを調査する!

コマンドが含まれるパッケージを探します。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ sudo dnf provides patch
Updating Subscription Management repositories.
patch-2.7.6-8.el8.x86_64 : Utility for modifying/upgrading files
Repo        : rhel-8-for-x86_64-baseos-rpms
Matched from:
Provide    : patch = 2.7.6-8.el8
 
patch-2.7.6-9.el8_0.x86_64 : Utility for modifying/upgrading files
Repo        : rhel-8-for-x86_64-baseos-rpms
Matched from:
Provide    : patch = 2.7.6-9.el8_0
 
patch-2.7.6-11.el8.x86_64 : Utility for modifying/upgrading files
Repo        : @System
Matched from:
Provide    : patch = 2.7.6-11.el8
 
patch-2.7.6-11.el8.x86_64 : Utility for modifying/upgrading files
Repo        : rhel-8-for-x86_64-baseos-rpms
Matched from:
Provide    : patch = 2.7.6-11.el8

インストールするパッケージの情報を確認する!

パッケージの情報を確認します。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$ sudo dnf info patch
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                    91 kB/s | 4.1 kB     00:00   
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                 76 kB/s | 4.5 kB     00:00   
Installed Packages
Name         : patch
Version      : 2.7.6
Release      : 11.el8
Architecture : x86_64
Size         : 261 k
Source       : patch-2.7.6-11.el8.src.rpm
Repository   : @System
From repo    : rhel-8-for-x86_64-baseos-rpms
Summary      : Utility for modifying/upgrading files
License      : GPLv3+
Description  : The patch program applies diff files to originals.  The diff command
             : is used to compare an original to a changed file.  Diff lists the
             : changes made to the file.  A person who has the original file can then
             : use the patch command with the diff file to add the changes to their
             : original file (patching the file).
             :
             : Patch should be installed because it is a common way of upgrading
             : applications.

パッケージをインストールします!

調査したパッケージ名を指定して、パッケージをインストールします。

1
sudo dnf install patch

おわりに

コマンドをインストールする場合に、パッケージ名がわからない場合は、「dnf provides」コマンドを使用して調べます。

参考情報

関連記事

関連書籍(Amazon)

N/A