よく使う、yum コマンド (yum groupinstallなど)
Yum(Yellowdog Updater Modified )コマンドのよく使うオプションなどのまとめ
Contents
情報取得 (yum provides, yum whatprovides)
パッケージ情報、アップデート可能なパッケージなどに関するコマンドは以下となります
yum list | アップデートが可能なパッケージ、新規インストールが可能なパッケージを表示 |
yum list updates | アップデートが可能なパッケージの一覧を表示 |
yum list installed | インストールされている全パッケージを表示 |
yum whatprovides [機能名/ファイル名] | 特定のコマンド・ファイル・ライブラリがどのYUMパッケージの中に含まれているのかをレポジトリから検索するオプション |
yum provides [ファイル名] | ファイルがどのパッケージに含まれるか調べる |
# yum providesコマンド
$ sudo yum provides libc.so.6
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: ftp.tsukuba.wide.ad.jp
* extras: ftp.tsukuba.wide.ad.jp
* updates: ftp.tsukuba.wide.ad.jp
glibc-2.17-78.el7.i686 : The GNU libc libraries
Repo : base
Matched from:
Provides : libc.so.6
# yum whatprovidesコマンド
$ sudo yum whatprovides libstdc++.so.5
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.tsukuba.wide.ad.jp
* extras: ftp.tsukuba.wide.ad.jp
* updates: ftp.tsukuba.wide.ad.jp
compat-libstdc++-33-3.2.3-72.el7.i686 : Compatibility standard C++ libraries
Repo : base
Matched from:
Provides : libstdc++.so.5
インストール・削除(yum instal, yum update)
パッケージのインストール、削除関係のコマンドは以下となります
yum install パッケージ名 | 指定したパッケージをインストール |
yum update パッケージ名 | 指定したパッケージをアップデート |
yum update | 全パッケージをアップデート |
yum remove パッケージ名 | 指定したパッケージを削除(アンインストール) |
yum clean all | ダウンロードしたパッケージ・古いヘッダー情報・キャッシュの削除 |
yum clean packages | ダウンロードしたパッケージを削除 |
yum groupinstall
yum groupinstallは、グループ化されているパッケージをまとめてインストール・アンインストールなどの操作を行うことができるコマンドです
yum groupinstall “グループ名" | 指定したグループ単位でインストール |
yum groupupdate “グループ名" | 指定したグループ単位で更新 |
yum grouplist | グループ一覧を表示 |
yum groupremove “グループ名" | 指定したグループ単位で削除(アンインストール) |
yum groupinfo “グループ名" | 指定したグループに含まれるデフォルトパッケージとオプションパッケージを表示 |
# yum grouplist
$ sudo yum grouplist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.tsukuba.wide.ad.jp
* extras: ftp.tsukuba.wide.ad.jp
* updates: ftp.tsukuba.wide.ad.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:
Development Tools
Available Groups:
Compatibility Libraries
Console Internet Tools
Graphical Administration Tools
Legacy UNIX Compatibility
Scientific Support
Security Tools
Smart Card Support
System Administration Tools
System Management
Done
# yum groupinstall
$ sudo yum groupinstall "Virtualization Host"
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.tsukuba.wide.ad.jp
* extras: ftp.tsukuba.wide.ad.jp
* updates: ftp.tsukuba.wide.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package NetworkManager.x86_64 1:1.0.0-16.git20150121.b4ea599c.el7_1 will be installed
依存関係を無視してアップデート[ yum –skip-broken ]
下記のように「Error: systemd conflicts with ・・・ You could try using –skip-broken to work around the problem」と表示される場合ですが、インストールされるパッケージで依存関係に不具合があるとアップデートできません。
下記のコマンドのように「yum update」で一括でアップデートしていると、アップデート対象のパッケージ内で一つでもエラーがあるとダメです
$ sudo yum update #省略 --> Finished Dependency Resolution --> Running transaction check ---> Package kernel-devel.x86_64 0:3.10.0-229.4.2.el7 will be erased ---> Package systemd.x86_64 0:208-20.el7_1.6 will be updated ---> Package systemd.x86_64 0:208-20.el7_1.6 will be updated --> Processing Conflict: systemd-219-19.el7.x86_64 conflicts initscripts < 9.49.28-1 --> Finished Dependency Resolution Error: systemd conflicts with initscripts-9.49.17-1.el7.x86_64 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest
その場合は、yum コマンドオプションに「–skip-broken」をつけてアップデートを行います
このオプッションは、httpd,php などのパッケージを指定しても利用できます
# 「skip-broken」を使用してアップデートしてみる $ sudo yum --skip-broken update # 「skip-broken」を使用して、httpd と php アップデートしてみる $ sudo yum -y --skip-broken update httpd php
ディスカッション
コメント一覧
まだ、コメントがありません