LinuCエヴァンジェリストの鯨井貴博@opensourcetechです。
CentOS7以降のyumサブコマンドgroupsで、yumグループを管理する方法の紹介です。
CentOS6など少し前のLinuxディストリビューションの場合、
以下のようにパッケージグループで「ベース」など細かく選択することが可能でした。
しかし、CentOS7以降のインストーラーでは、以下のように詳細なグループが選択できません。
ですので、OSインストール完了後、そのグループを追加インストールします。
まず、yum groups list。
yumグループの一覧をしてくれます。
しかし、期待した「ベース」などは表示されません。
[root@localhost ~]# yum groups list 読み込んだプラグイン:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: ftp.yz.yamagata-u.ac.jp * extras: ftp.yz.yamagata-u.ac.jp * updates: ftp.yz.yamagata-u.ac.jp Available Environment Groups: 最小限のインストール インフラストラクチャーサーバー コンピュートノード ファイルとプリントサーバー ベーシック Web サーバー 仮想化ホスト サーバー (GUI 使用) GNOME Desktop KDE Plasma Workspaces 開発およびクリエイティブワークステーション 利用可能なグループ グラフィカル管理ツール コンソールインターネットツール システム管理 システム管理ツール スマートカードサポート セキュリティーツール レガシーな UNIX 互換性 互換性ライブラリー 科学的サポート 開発ツール 完了
そこで使うのが、hiddenオプション!
以下のように期待するyumグループが表示されます。
Available Enviroment GroupsにOSインストール時の選択肢が、
インストール済みグループにはインストール済みのyumグループが、
利用可能なグループには指定可能なyumグループが一覧表示されます。
ちゃんと「ベース」もありますね。
[root@localhost ~]# yum groups list hidden 読み込んだプラグイン:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: ftp.yz.yamagata-u.ac.jp * extras: ftp.yz.yamagata-u.ac.jp * updates: ftp.yz.yamagata-u.ac.jp Available Environment Groups: 最小限のインストール インフラストラクチャーサーバー コンピュートノード ファイルとプリントサーバー ベーシック Web サーバー 仮想化ホスト サーバー (GUI 使用) GNOME Desktop KDE Plasma Workspaces 開発およびクリエイティブワークステーション インストール済みグループ: ベース 利用可能なグループ Anaconda ツール CentOS Linux Client 製品コア CentOS Linux ComputeNode 製品コア CentOS Linux Server 製品コア CentOS Linux Workstation 製品コア DNS ネームサーバー Emacs FTP サーバー GNOME GNOME アプリケーション Hyper-v プラットフォーム固有のパッケージ Identity Management Server Infiniband のサポート Java プラットフォーム KDE KDE アプリケーション KDE マルチメディアサポート KVM プラットフォーム固有のパッケージ Linux 向けリモート管理 MariaDB データベースクライアント MariaDB データベースサーバー PHP サポート Perl - Web 向け Perl のサポート PostgreSQL データベースクライアント PostgreSQL データベースサーバー Python Resilient Storage Ruby サポート VMware プラットフォーム固有のパッケージ Web サーバー Web サーブレットエンジン X Window System その他の開発 インターネットアプリケーション インターネットブラウザー オフィススイートと生産性 グラフィカル管理ツール グラフィックスツール ゲストエージェント ゲストデスクトップエージェント コア コンソールインターネットツール システム管理 システム管理ツール スマートカードサポート セキュリティーツール ダイヤルアップネットワークサポート ディレクトリーサーバー ディレクトリー接続クライアント デスクトップのデバッグとパフォーマンスツール デバッグツール ネットワーキングツール ネットワークインフラストラクチャサーバー ネットワークファイルシステムクライアント ハードウェアモニタリングユーティリティー バックアップクライアント バックアップサーバー パフォーマンスツール ファイルとストレージサーバー フォント プラットフォーム開発 プリントサーバー マルチメディア メインフレームアクセス メールサーバー リモートデスクトップ接続クライアント レガシーな UNIX 互換性 レガシーな X ウィンドウシステム互換性 ロードバランサー 一般的な NetworkManager サブモジュール 互換性ライブラリー 仮想化クライアント 仮想化ツール 仮想化ハイパーバイザー 仮想化プラットフォーム 入力メソッド 印刷クライアント 大規模システムのパフォーマンス 技術文書 科学的サポート 競合 (Client) 競合 (ComputeNode) 競合 (Server) 競合 (Workstation) 開発ツール 高可用性 完了
idsオプションを付けると、グループインストール時に使用できるグループIDが表示されます。
[root@localhost ~]# yum groups list hidden ids 読み込んだプラグイン:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: ftp.yz.yamagata-u.ac.jp * extras: ftp.yz.yamagata-u.ac.jp * updates: ftp.yz.yamagata-u.ac.jp Available Environment Groups: 最小限のインストール (minimal) インフラストラクチャーサーバー (infrastructure-server-environment) コンピュートノード (compute-node-environment) ファイルとプリントサーバー (file-print-server-environment) ベーシック Web サーバー (web-server-environment) 仮想化ホスト (virtualization-host-environment) サーバー (GUI 使用) (graphical-server-environment) GNOME Desktop (gnome-desktop-environment) KDE Plasma Workspaces (kde-desktop-environment) 開発およびクリエイティブワークステーション (developer-workstation-environment) インストール済みグループ: ベース (base) 利用可能なグループ Anaconda ツール (anaconda-tools) CentOS Linux Client 製品コア (client-product) CentOS Linux ComputeNode 製品コア (computenode-product) CentOS Linux Server 製品コア (server-product) CentOS Linux Workstation 製品コア (workstation-product) DNS ネームサーバー (dns-server) Emacs (emacs) FTP サーバー (ftp-server) GNOME (gnome-desktop) GNOME アプリケーション (gnome-apps) Hyper-v プラットフォーム固有のパッケージ (platform-microsoft) Identity Management Server (identity-management-server) Infiniband のサポート (infiniband) Java プラットフォーム (java-platform) KDE (kde-desktop) KDE アプリケーション (kde-apps) KDE マルチメディアサポート (kde-media) KVM プラットフォーム固有のパッケージ (platform-kvm) Linux 向けリモート管理 (remote-system-management) MariaDB データベースクライアント (mariadb-client) MariaDB データベースサーバー (mariadb) PHP サポート (php) Perl - Web 向け (perl-web) Perl のサポート (perl-runtime) PostgreSQL データベースクライアント (postgresql-client) PostgreSQL データベースサーバー (postgresql) Python (python-web) Resilient Storage (resilient-storage) Ruby サポート (ruby-runtime) VMware プラットフォーム固有のパッケージ (platform-vmware) Web サーバー (web-server) Web サーブレットエンジン (web-servlet) X Window System (x11) その他の開発 (additional-devel) インターネットアプリケーション (internet-applications) インターネットブラウザー (internet-browser) オフィススイートと生産性 (office-suite) グラフィカル管理ツール (graphical-admin-tools) グラフィックスツール (graphics) ゲストエージェント (guest-agents) ゲストデスクトップエージェント (guest-desktop-agents) コア (core) コンソールインターネットツール (console-internet) システム管理 (system-management) システム管理ツール (system-admin-tools) スマートカードサポート (smart-card) セキュリティーツール (security-tools) ダイヤルアップネットワークサポート (dial-up) ディレクトリーサーバー (directory-server) ディレクトリー接続クライアント (directory-client) デスクトップのデバッグとパフォーマンスツール (desktop-debugging) デバッグツール (debugging) ネットワーキングツール (network-tools) ネットワークインフラストラクチャサーバー (network-server) ネットワークファイルシステムクライアント (network-file-system-client) ハードウェアモニタリングユーティリティー (hardware-monitoring) バックアップクライアント (backup-client) バックアップサーバー (backup-server) パフォーマンスツール (performance) ファイルとストレージサーバー (file-server) フォント (fonts) プラットフォーム開発 (platform-devel) プリントサーバー (print-server) マルチメディア (multimedia) メインフレームアクセス (mainframe-access) メールサーバー (mail-server) リモートデスクトップ接続クライアント (remote-desktop-clients) レガシーな UNIX 互換性 (legacy-unix) レガシーな X ウィンドウシステム互換性 (legacy-x) ロードバランサー (load-balancer) 一般的な NetworkManager サブモジュール (networkmanager-submodules) 互換性ライブラリー (compat-libraries) 仮想化クライアント (virtualization-client) 仮想化ツール (virtualization-tools) 仮想化ハイパーバイザー (virtualization-hypervisor) 仮想化プラットフォーム (virtualization-platform) 入力メソッド (input-methods) 印刷クライアント (print-client) 大規模システムのパフォーマンス (large-systems) 技術文書 (technical-writing) 科学的サポート (scientific) 競合 (Client) (conflicts-client) 競合 (ComputeNode) (conflicts-computenode) 競合 (Server) (conflicts-server) 競合 (Workstation) (conflicts-workstation) 開発ツール (development) 高可用性 (ha) 完了
LANG=Cを付けて英語表記で表示させることもできます。
[root@localhost ~]# LANG=C yum groups list hidden Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: ftp.yz.yamagata-u.ac.jp * extras: ftp.yz.yamagata-u.ac.jp * updates: ftp.yz.yamagata-u.ac.jp Available Environment Groups: Minimal Install Compute Node Infrastructure Server File and Print Server Basic Web Server Virtualization Host Server with GUI GNOME Desktop KDE Plasma Workspaces Development and Creative Workstation Installed Groups: Base Available Groups: Additional Development Anaconda Tools Backup Client Backup Server CentOS Linux Client product core CentOS Linux ComputeNode product core CentOS Linux Server product core CentOS Linux Workstation product core Common NetworkManager submodules Compatibility Libraries Conflicts (Client) Conflicts (ComputeNode) Conflicts (Server) Conflicts (Workstation) Console Internet Tools Core DNS Name Server Debugging Tools Desktop Debugging and Performance Tools Development Tools Dial-up Networking Support Directory Client Directory Server E-mail Server Emacs FTP Server File and Storage Server Fonts GNOME GNOME Applications Graphical Administration Tools Graphics Creation Tools Guest Agents Guest Desktop Agents Hardware Monitoring Utilities High Availability Hyper-v platform specific packages Identity Management Server Infiniband Support Input Methods Internet Applications Internet Browser Java Platform KDE KDE Applications KDE Multimedia Support KVM platform specific packages Large Systems Performance Legacy UNIX Compatibility Legacy X Window System Compatibility Load Balancer Main
各yumグループの詳細は、groups infoで確認できます。
先頭に付いている「=」はyum groups install baseなどとした際にインストールされたパッケージ、
「+」はyum groups install baseなどとした際に追加されるパッケージ、
何もついていないものはOSインストール時に導入されたパッケージなどです。
[root@localhost ~]# yum groups info base 読み込んだプラグイン:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: ftp.yz.yamagata-u.ac.jp * extras: ftp.yz.yamagata-u.ac.jp * updates: ftp.yz.yamagata-u.ac.jp グループ: ベース グループ ID: base 説明: CentOS Linux の基本インストール 強制的なパッケージ: acl =at =attr =bc =bind-utils =centos-indexhtml cpio =crda crontabs =cyrus-sasl-plain dbus =ed file logrotate =lsof man-db =net-tools =ntsysv =pciutils =psacct =quota =setserial =traceroute =usb_modeswitch 標準パッケージ: =abrt-addon-ccpp =abrt-addon-python =abrt-cli =abrt-console-notification =bash-completion =blktrace =bpftool =bridge-utils =bzip2 chrony =cryptsetup =dmraid =dosfstools ethtool =fprintd-pam gnupg2 =hunspell =hunspell-en =kmod-kvdo =kpatch =ledmon libaio =libreport-plugin-mailx =libstoragemgmt lvm2 =man-pages =man-pages-overrides =mdadm =mlocate =mtr =nano =ntpdate =pinfo plymouth =pm-utils =rdate =rfkill =rng-tools rsync =scl-utils =setuptool =smartmontools =sos =sssd-client =strace =sysstat =systemtap-runtime tcpdump =tcsh teamd =time =unzip =usbutils =vdo =vim-enhanced virt-what =wget which =words =xfsdump xz =yum-langpacks =yum-utils =zip オプション パッケージ: PyPAM acpid audispd-plugins augeas bcc brltty ceph-common cryptsetup-reencrypt daxio device-mapper-persistent-data dos2unix dumpet fwupd fwupdate genisoimage gpm i2c-tools ima-evm-utils insights-client kabi-yum-plugins libatomic libcgroup libcgroup-tools libitm libstoragemgmt-arcconf-plugin libstoragemgmt-hpsa-plugin libstoragemgmt-local-plugin libstoragemgmt-megaraid-plugin libstoragemgmt-netapp-plugin libstoragemgmt-nfs-plugin libstoragemgmt-nfs-plugin-clibs libstoragemgmt-nstor-plugin libstoragemgmt-smis-plugin libstoragemgmt-targetd-plugin libstoragemgmt-udev linuxptp logwatch mkbootdisk mtools ncurses-term ntp nvme-cli nvmetcli oddjob pax perl-gettext prelink python-subprocess32 python-volume_key redhat-lsb-core redhat-upgrade-dracut redhat-upgrade-tool rsyslog-gnutls rsyslog-gssapi rsyslog-kafka rsyslog-relp sgpio sos-collector sox squashfs-tools star tmpwatch udftools usbguard uuidd volume_key wodim x86info yum-plugin-aliases yum-plugin-changelog yum-plugin-tmprepo yum-plugin-verify yum-plugin-versionlock zsh 条件付パッケージ: -rubygem-abrt [root@localhost ~]# yum groups info fonts 読み込んだプラグイン:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: ftp.yz.yamagata-u.ac.jp * extras: ftp.yz.yamagata-u.ac.jp * updates: ftp.yz.yamagata-u.ac.jp グループ: フォント グループ ID: fonts 説明: 異なる言語やスクリプトにテキストをレンダリングするためのフォント 標準パッケージ: +cjkuni-uming-fonts +dejavu-sans-fonts +dejavu-sans-mono-fonts +dejavu-serif-fonts +gnu-free-mono-fonts +gnu-free-sans-fonts +gnu-free-serif-fonts +google-crosextra-caladea-fonts +google-crosextra-carlito-fonts +google-noto-emoji-fonts +jomolhari-fonts +khmeros-base-fonts +liberation-mono-fonts +liberation-sans-fonts +liberation-serif-fonts +lklug-fonts +lohit-assamese-fonts +lohit-bengali-fonts +lohit-devanagari-fonts +lohit-gujarati-fonts +lohit-kannada-fonts +lohit-malayalam-fonts +lohit-marathi-fonts +lohit-nepali-fonts +lohit-oriya-fonts +lohit-punjabi-fonts +lohit-tamil-fonts +lohit-telugu-fonts +madan-fonts +nhn-nanum-gothic-fonts +open-sans-fonts +overpass-fonts +paktype-naskh-basic-fonts +paratype-pt-sans-fonts +sil-abyssinica-fonts +sil-nuosu-fonts +sil-padauk-fonts +smc-meera-fonts +stix-fonts +thai-scalable-waree-fonts +ucs-miscfixed-fonts +vlgothic-fonts +wqy-microhei-fonts +wqy-zenhei-fonts オプション パッケージ: bitmap-fixed-fonts bitmap-lucida-typewriter-fonts bpg-chveulebrivi-fonts bpg-courier-fonts bpg-glaho-fonts cjkuni-ukai-fonts culmus-aharoni-clm-fonts culmus-caladings-clm-fonts culmus-david-clm-fonts culmus-drugulin-clm-fonts culmus-ellinia-clm-fonts culmus-frank-ruehl-clm-fonts culmus-hadasim-clm-fonts culmus-keteryg-fonts culmus-miriam-clm-fonts culmus-miriam-mono-clm-fonts culmus-nachlieli-clm-fonts culmus-simple-clm-fonts culmus-stamashkenaz-clm-fonts culmus-stamsefarad-clm-fonts culmus-yehuda-clm-fonts ghostscript-chinese google-noto-sans-armenian-fonts google-noto-sans-devanagari-fonts google-noto-sans-devanagari-ui-fonts google-noto-sans-ethiopic-fonts google-noto-sans-fonts google-noto-sans-georgian-fonts google-noto-sans-hebrew-fonts google-noto-sans-khmer-fonts google-noto-sans-khmer-ui-fonts google-noto-sans-lao-fonts google-noto-sans-lao-ui-fonts google-noto-sans-tamil-fonts google-noto-sans-tamil-ui-fonts google-noto-sans-thai-fonts google-noto-sans-thai-ui-fonts google-noto-sans-ui-fonts google-noto-serif-armenian-fonts google-noto-serif-fonts google-noto-serif-georgian-fonts google-noto-serif-lao-fonts google-noto-serif-thai-fonts gubbi-fonts ipa-gothic-fonts ipa-mincho-fonts ipa-pgothic-fonts ipa-pmincho-fonts kacst-art-fonts kacst-book-fonts kacst-decorative-fonts kacst-digital-fonts kacst-farsi-fonts kacst-letter-fonts kacst-naskh-fonts kacst-office-fonts kacst-one-fonts kacst-pen-fonts kacst-poster-fonts kacst-qurn-fonts kacst-screen-fonts kacst-title-fonts kacst-titlel-fonts khmeros-battambang-fonts khmeros-bokor-fonts khmeros-handwritten-fonts khmeros-metal-chrieng-fonts khmeros-muol-fonts khmeros-siemreap-fonts kurdit-unikurd-web-fonts liberation-narrow-fonts nafees-web-naskh-fonts navilu-fonts nhn-nanum-brush-fonts nhn-nanum-myeongjo-fonts nhn-nanum-pen-fonts paktype-naqsh-fonts paktype-tehreer-fonts pothana2000-fonts saab-fonts samyak-devanagari-fonts samyak-gujarati-fonts samyak-malayalam-fonts samyak-oriya-fonts samyak-tamil-fonts smc-anjalioldlipi-fonts smc-dyuthi-fonts smc-kalyani-fonts smc-rachana-fonts smc-raghumalayalam-fonts smc-suruma-fonts thai-scalable-garuda-fonts thai-scalable-kinnari-fonts thai-scalable-loma-fonts thai-scalable-norasi-fonts thai-scalable-purisa-fonts thai-scalable-sawasdee-fonts thai-scalable-tlwgmono-fonts thai-scalable-tlwgtypewriter-fonts thai-scalable-tlwgtypist-fonts thai-scalable-tlwgtypo-fonts thai-scalable-umpush-fonts tibetan-machine-uni-fonts vemana2000-fonts vlgothic-p-fonts
groups A command, new in 3.4.2, that collects all the subcommands that act on groups together. Note that recent yum using distributions (Fedora-19+, RHEL-7+) have configured group_command=objects which changes how group commands act in some important ways. "group install" is used to install all of the individual packages in a group, of the specified types (this works as if you'd taken each of those package names and put them on the command line for a "yum install" command). The group_package_types configuration option specifies which types will be installed. If you wish to "reinstall" a group so that you get a package that is currently blacklisted the easi‐ est way to do that currently is to install the package manually and then run "groups mark packages- sync mygroup mypackagename" (or use yumdb to set the group_member of the package(s)). "group update" is just an alias for group install, when using group_command=compat. This will install packages in the group not already installed and upgrade existing packages. With group_command=simple it will just upgrade already installed packages. With group_command=objects it will try to upgrade the group object, installing any available packages not blacklisted (marked '-' in group info) and will upgrade the installed packages. "group list" is used to list the available groups from all yum repos. When group_command=objects the group is installed if the user explicitly installed it (or used the group mark* commands to mark it installed). It does not need to have any packages installed. When not using group_command=objects groups are shown as "installed" if all mandatory packages are installed, or if a group doesn't have any mandatory packages then it is installed if any of the optional or default package are installed (when not in group_command=objects mode). You can pass optional arguments to the list/summary com‐ mands: installed, available, environment, language, packages, hidden and ids (or any of those prefixed by "no" to turn them off again). Note that groups that are available but hidden will not be listed unless ´hidden´ keyword is passed to the command. If you pass the -v option, to enable verbose mode, then the groupids are displayed by default (but "yum group list ids" is often easier to read). "group remove" is used to remove all of the packages in a group, unlike "groupinstall" this will remove everything regardless of group_package_types. It is worth pointing out that packages can be in more than one group, so "group install X Y" followed by "group remove Y" does not do give you the same result as "group install X". The groupremove_leaf_only configuration changes the behaviour of this command to only remove packages which aren't required by something else. "group info" is used to give the description and package list of a group (and which type those pack‐ ages are marked as). Note that you can use the yum-filter-data and yum-list-data plugins to get/use the data the other way around (i.e. what groups own packages need updating). If you pass the -v option, to enable verbose mode, then the package names are matched against installed/available pack‐ ages similar to the list command. When using group_command=objects, the info command will display markers next to each package saying how that package relates to the group object. The meaning of these markers is: "-" = Package isn't installed, and won't be installed as part of the group (Eg. "yum group install foo -pkgA" or "yum group install foo; yum remove pkgA" … this will have pkgA marked as '-') "+" = Package isn't installed, but will be the next time you run "yum upgrade" or "yum group upgrade foo" " " = Package is installed, but wasn't installed via the group (so "group remove foo" won't remove it). "=" = Package is installed, and was installed via the group. you can move an installed package into an installed group using either "group mark package-sync/pack‐ age-sync-forced" or "yumdb set group_member". "group summary" is used to give a quick summary of how many groups are installed and available. "group mark" and "group unmark" are used when groups are configured in group_command=objects mode. These commands then allow you to alter yum's idea of which groups are installed, and the packages that belong to them. "group mark install" mark the group as installed. When installed "yum upgrade" and "yum group upgrade" will install new packages for the group (only those packages already installed will be marked as mem‐ bers of the installed group to start with). "group mark remove" the opposite of mark install. "group mark packages" takes a group id (which must be installed) and marks any given installed pack‐ ages (which aren't members of a group) as members of the group. Note that the data from the reposito‐ ries does not need to specify the packages as a member of the group. "group mark packages-force" works like mark packages, but doesn't care if the packages are already members of another group. "group mark blacklist" will blacklist all packages marked to be installed for a group. After this com‐ mand a "yum group upgrade" will not install any new packages as part of the group. "group mark convert-blacklist" "group mark convert-whitelist" "group mark convert" converts the automatic data you get without using groups as objects into groups as objects data, in other words this will make "yum --setopt=group_command=objects groups list" look as similar as possible to the current output of "yum --setopt=group_command=simple groups list". This makes it much easier to convert to groups as objects without having to reinstall. For groups that are installed the whitelist variant will mark all uninstalled packages for the group as to be installed on the next "yum group upgrade", the blacklist variant (current default) will mark them all as black‐ listed. "group unmark packages" remove a package as a member from any groups.
その他、yumグループを対象とした更新は「yum groups update」、削除は「yum groups remove」で行うことができます。
これで、yumグループを使った管理も怖くないですね。