ウェブサイト検索

CentOS および RHEL で Yum を使用してパッケージのグループをインストールする方法


CentOS/RHEL では、パッケージを個別にインストールすることも、グループ内の 1 回の操作で複数のパッケージをインストールすることもできます。パッケージ グループには、開発ツール、Web サーバー (LAMP や LEMP など)、デスクトップ (シン クライアントとしても使用できる最小限のデスクトップ) などの関連タスクを実行するパッケージが含まれています。

こちらもお読みください: RHEL、CentOS、Fedora にインストールされているすべてのパッケージを一覧表示する 3 つの方法

このガイドでは、CentOS、RHEL、および Fedora ディストリビューションで YUM パッケージ マネージャーを使用してパッケージのグループをインストールする方法を説明します。

yum バージョン 3.4.2 から、groups コマンドが導入され、Fedora-19 以降およびCentOS/RHEL-7 以降で動作するようになりました。これには、グループを処理するためのすべてのサブコマンドがまとめられています。

すべての yum リポジトリから利用可能なグループを一覧表示するには、次のように list サブコマンドを使用します。

yum groups list
OR
yum grouplist
Loaded plugins: changelog, fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.freethought-internet.co.uk
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com
Available Environment Groups:
   Minimal Install
   Compute Node
   Infrastructure Server
   File and Print Server
   MATE Desktop
   Basic Web Server
   Virtualization Host
   Server with GUI
   GNOME Desktop
   KDE Plasma Workspaces
   Development and Creative Workstation
Available Groups:
   CIFS file server
   Compatibility Libraries
   Console Internet Tools
....

グループの合計数は、summary サブコマンドを使用して確認できます。

yum groups summary
Loaded plugins: changelog, fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.freethought-internet.co.uk
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com
Available Environment Groups: 11
Available Groups: 38
Done

パッケージのグループのインストールに進む前に、info サブコマンドを使用して、グループのID、グループの簡単な説明、およびそのグループに含まれるさまざまなパッケージをさまざまなカテゴリ (必須、デフォルト、およびオプションのパッケージ) で表示できます。 。

yum groups info "Development Tools"
Loaded plugins: changelog, fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.freethought-internet.co.uk
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com

Group: Development Tools
 Group-Id: development
 Description: A basic development environment.
 Mandatory Packages:
   +autoconf
   +automake
    binutils
   +bison
   +flex
    gcc
   +gcc-c++
    gettext
   +libtool
    make
   +patch
    pkgconfig
    redhat-rpm-config
   +rpm-build
   +rpm-sign
...

たとえば開発ツール (基本的な開発環境) などのパッケージのグループをインストールするには、次のように install サブコマンドを使用します。

yum groups install "Development Tools"
Loaded plugins: changelog, fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
base                                                                                                                                                 | 3.6 kB  00:00:00     
epel/x86_64/metalink                                                                                                                                 |  23 kB  00:00:00     
epel                                                                                                                                                 | 4.3 kB  00:00:00     
extras                                                                                                                                               | 3.4 kB  00:00:00     
mariadb                                                                                                                                              | 2.9 kB  00:00:00     
updates                                                                                                                                              | 3.4 kB  00:00:00     
(1/4): extras/7/x86_64/primary_db                                                                                                                    | 129 kB  00:00:15     
(2/4): updates/7/x86_64/primary_db                                                                                                                   | 3.6 MB  00:00:15     
(3/4): epel/x86_64/primary_db                                                                                                                        | 6.1 MB  00:00:15     
(4/4): epel/x86_64/updateinfo                                                                                                                        | 838 kB  00:00:15     
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.freethought-internet.co.uk
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch 0:2.69-11.el7 will be installed
--> Processing Dependency: m4 >= 1.4.14 for package: autoconf-2.69-11.el7.noarch
---> Package automake.noarch 0:1.13.4-3.el7 will be installed
...

グループを削除するには (グループ内のすべてのパッケージがシステムから消去されます)、remove サブコマンドを使用するだけです。

yum groups remove "Development Tools"

以下のコマンドを使用して、グループをインストール済みとしてマークすることもできます。

yum groups mark install "Development Tools"

それは今のところすべてです! yum man ページのグループ サブセクションで、さらに多くのサブコマンドとその説明を見つけることができます。

Yum パッケージ マネージャーに関する次の記事もお読みください。

  1. 「yum-utils」をインストールして使用して Yum を維持し、パフォーマンスを向上させる方法
  2. Yum コマンドを使用して特定のパッケージの更新を無効化/ロックする 4 つの方法
  3. Yum エラーを修正する方法: データベース ディスク イメージの形式が正しくありません
  4. 「Yum History」を使用してインストールまたは削除されたパッケージ情報を確認する方法

このガイドでは、CentOS、RHEL、および Fedora で YUM パッケージ マネージャーを使用してパッケージのグループをインストールする方法を説明しました。この記事に関するご質問やご意見は、以下のコメント フォームを使用してお送りください。