問題ID: 22130 について、

  • フォーラムは新サイトへ移行しました。
  • このフォーラムではゲスト投稿が禁止されています
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2016-4-10 22:02
crono  新米   投稿数: 5
お世話になっています。

【 問題ID: 22130 】
インターネット上ないしはメディア上のパッケージ情報のデータベースを使い、依存関係を調整しながら、パッケージのインストール・アンインストール・アップグレードを行うことができるコマンドは次のうちどれか。

rpmyum
yum
yumdownloader
rpm
rpm2cpio

正解:yum

となっていますが、rpmではだめなのでしょうか?
rpmもパッケージインストール・アップグレード・アンインストールできると思うのですが。
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 | 投稿日時 2016-4-11 8:11
arashi1977  長老 居住地: 広島  投稿数: 1715
引用:
rpmもパッケージインストール・アップグレード・アンインストールできると思うのですが。
そうですね、rpmで「パッケージインストール・アップグレード・アンインストール」することはできます。けど設問の条件をよく見ると
引用:
インターネット上ないしはメディア上のパッケージ情報のデータベースを使い、依存関係を調整しながら
とありますね。ここが大事です。
参考を見てみると
引用:
●YUM(Yellowdog Updater Modified)ツール
YUMツールはRPMツールを拡張したツール群です。インターネット上ないしはメディア上のパッケージ情報のデータベースを使い、依存関係を調整しながらパッケージ管理を行うことができます。
を書かれています。

具体例を出してみましょう。
WebサーバでPHPが使えるようにしたいので、とりあえずphpパッケージをインストールしようと思い、rpmでインストールしようとすると以下の様な結果になります。
# rpm -ivh php-5.3.3-40.el6_6.x86_64.rpm
error: Failed dependencies:
	httpd is needed by php-5.3.3-40.el6_6.x86_64
	httpd-mmn = 20051115 is needed by php-5.3.3-40.el6_6.x86_64
	php-cli(x86-64) = 5.3.3-40.el6_6 is needed by php-5.3.3-40.el6_6.x86_64
	php-common(x86-64) = 5.3.3-40.el6_6 is needed by php-5.3.3-40.el6_6.x86_64
「php」パッケージが「httpd, httpd-mmn, php-cli, php-common」パッケージに依存しているのにインストールされていないため、「php」パッケージ自体のインストールに失敗します。
ではyumを使うとどうなるかですが、以下のように「インストールするパッケージが依存するパッケージも全てインストール(依存関係を調整)」してくれるんです。
インストールやアンインストールの処理はrpmが行いますが、それだけでは解決できない依存関係の調整ができるもの、ということでrpmコマンドでは不正解になるんですね
# yum -y install php
Loaded plugins: fastestmirror
Setting up Install Process
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
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.3-46.el6_7.1 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-46.el6_7.1 for package: php-5.3.3-46.el6_7.1.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.3.3-46.el6_7.1 for package: php-5.3.3-46.el6_7.1.x86_64
--> Processing Dependency: httpd-mmn = 20051115 for package: php-5.3.3-46.el6_7.1.x86_64
--> Processing Dependency: httpd for package: php-5.3.3-46.el6_7.1.x86_64
--> Running transaction check
---> Package httpd.x86_64 0:2.2.15-47.el6.centos.4 will be installed
--> Processing Dependency: httpd-tools = 2.2.15-47.el6.centos.4 for package: httpd-2.2.15-47.el6.centos.4.x86_64
--> Processing Dependency: system-logos >= 7.92.1-1 for package: httpd-2.2.15-47.el6.centos.4.x86_64
--> Processing Dependency: initscripts >= 8.36 for package: httpd-2.2.15-47.el6.centos.4.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-47.el6.centos.4.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-47.el6.centos.4.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-47.el6.centos.4.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-47.el6.centos.4.x86_64
---> Package php-cli.x86_64 0:5.3.3-46.el6_7.1 will be installed
--> Processing Dependency: libedit.so.0()(64bit) for package: php-cli-5.3.3-46.el6_7.1.x86_64
---> Package php-common.x86_64 0:5.3.3-46.el6_7.1 will be installed
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package httpd-tools.x86_64 0:2.2.15-47.el6.centos.4 will be installed
---> Package initscripts.x86_64 0:9.03.49-1.el6.centos.4 will be installed
--> Processing Dependency: util-linux-ng >= 2.16 for package: initscripts-9.03.49-1.el6.centos.4.x86_64
--> Processing Dependency: udev >= 125-1 for package: initscripts-9.03.49-1.el6.centos.4.x86_64
--> Processing Dependency: sysvinit-tools >= 2.87-6 for package: initscripts-9.03.49-1.el6.centos.4.x86_64
--> Processing Dependency: /sbin/pidof for package: initscripts-9.03.49-1.el6.centos.4.x86_64
--> Processing Dependency: /sbin/ip for package: initscripts-9.03.49-1.el6.centos.4.x86_64
--> Processing Dependency: /sbin/blkid for package: initscripts-9.03.49-1.el6.centos.4.x86_64
--> Processing Dependency: /sbin/arping for package: initscripts-9.03.49-1.el6.centos.4.x86_64
---> Package libedit.x86_64 0:2.11-4.20080712cvs.1.el6 will be installed
---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed
---> Package redhat-logos.noarch 0:60.0.14-12.el6.centos will be installed
--> Running transaction check
---> Package iproute.x86_64 0:2.6.32-45.el6 will be installed
--> Processing Dependency: iptables >= 1.4.5 for package: iproute-2.6.32-45.el6.x86_64
--> Processing Dependency: libxtables.so.4()(64bit) for package: iproute-2.6.32-45.el6.x86_64
---> Package iputils.x86_64 0:20071127-20.el6 will be installed
---> Package sysvinit-tools.x86_64 0:2.87-6.dsf.el6 will be installed
---> Package udev.x86_64 0:147-2.63.el6_7.1 will be installed
--> Processing Dependency: hwdata for package: udev-147-2.63.el6_7.1.x86_64
---> Package util-linux-ng.x86_64 0:2.17.2-12.18.el6 will be installed
--> Running transaction check
---> Package hwdata.noarch 0:0.233-14.1.el6 will be installed
---> Package iptables.x86_64 0:1.4.7-16.el6 will be installed
--> Processing Dependency: policycoreutils for package: iptables-1.4.7-16.el6.x86_64
--> Running transaction check
---> Package policycoreutils.x86_64 0:2.0.83-24.el6 will be installed
--> Processing Dependency: libdbus-glib-1.so.2()(64bit) for package: policycoreutils-2.0.83-24.el6.x86_64
--> Running transaction check
---> Package dbus-glib.x86_64 0:0.86-6.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================
 Package                    Arch              Version                                Repository          Size
==============================================================================================================
Installing:
 php                        x86_64            5.3.3-46.el6_7.1                       updates            1.1 M
Installing for dependencies:
 apr                        x86_64            1.3.9-5.el6_2                          base               123 k
 apr-util                   x86_64            1.3.9-3.el6_0.1                        base                87 k
 apr-util-ldap              x86_64            1.3.9-3.el6_0.1                        base                15 k
 dbus-glib                  x86_64            0.86-6.el6                             base               170 k
 httpd                      x86_64            2.2.15-47.el6.centos.4                 updates            831 k
 httpd-tools                x86_64            2.2.15-47.el6.centos.4                 updates             77 k
 hwdata                     noarch            0.233-14.1.el6                         base               1.3 M
 initscripts                x86_64            9.03.49-1.el6.centos.4                 updates            945 k
 iproute                    x86_64            2.6.32-45.el6                          base               367 k
 iptables                   x86_64            1.4.7-16.el6                           base               254 k
 iputils                    x86_64            20071127-20.el6                        base               120 k
 libedit                    x86_64            2.11-4.20080712cvs.1.el6               base                74 k
 mailcap                    noarch            2.1.31-2.el6                           base                27 k
 php-cli                    x86_64            5.3.3-46.el6_7.1                       updates            2.2 M
 php-common                 x86_64            5.3.3-46.el6_7.1                       updates            529 k
 policycoreutils            x86_64            2.0.83-24.el6                          base               651 k
 redhat-logos               noarch            60.0.14-12.el6.centos                  base                15 M
 sysvinit-tools             x86_64            2.87-6.dsf.el6                         base                60 k
 udev                       x86_64            147-2.63.el6_7.1                       updates            355 k
 util-linux-ng              x86_64            2.17.2-12.18.el6                       base               1.6 M

Transaction Summary
==============================================================================================================
Install      21 Package(s)

Total download size: 25 M
Installed size: 55 M
Downloading Packages:
(1/21): apr-1.3.9-5.el6_2.x86_64.rpm                                                   | 123 kB     00:00
(2/21): apr-util-1.3.9-3.el6_0.1.x86_64.rpm                                            |  87 kB     00:00
(3/21): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm                                       |  15 kB     00:00
(4/21): dbus-glib-0.86-6.el6.x86_64.rpm                                                | 170 kB     00:00
(5/21): httpd-2.2.15-47.el6.centos.4.x86_64.rpm                                        | 831 kB     00:00
(6/21): httpd-tools-2.2.15-47.el6.centos.4.x86_64.rpm                                  |  77 kB     00:00
(7/21): hwdata-0.233-14.1.el6.noarch.rpm                                               | 1.3 MB     00:00
(8/21): initscripts-9.03.49-1.el6.centos.4.x86_64.rpm                                  | 945 kB     00:00
(9/21): iproute-2.6.32-45.el6.x86_64.rpm                                               | 367 kB     00:00
(10/21): iptables-1.4.7-16.el6.x86_64.rpm                                              | 254 kB     00:00
(11/21): iputils-20071127-20.el6.x86_64.rpm                                            | 120 kB     00:00
(12/21): libedit-2.11-4.20080712cvs.1.el6.x86_64.rpm                                   |  74 kB     00:00
(13/21): mailcap-2.1.31-2.el6.noarch.rpm                                               |  27 kB     00:00
(14/21): php-5.3.3-46.el6_7.1.x86_64.rpm                                               | 1.1 MB     00:00
(15/21): php-cli-5.3.3-46.el6_7.1.x86_64.rpm                                           | 2.2 MB     00:00
(16/21): php-common-5.3.3-46.el6_7.1.x86_64.rpm                                        | 529 kB     00:00
(17/21): policycoreutils-2.0.83-24.el6.x86_64.rpm                                      | 651 kB     00:00
(18/21): redhat-logos-60.0.14-12.el6.centos.noarch.rpm                                 |  15 MB     00:03
(19/21): sysvinit-tools-2.87-6.dsf.el6.x86_64.rpm                                      |  60 kB     00:00
(20/21): udev-147-2.63.el6_7.1.x86_64.rpm                                              | 355 kB     00:00
(21/21): util-linux-ng-2.17.2-12.18.el6.x86_64.rpm                                     | 1.6 MB     00:00
--------------------------------------------------------------------------------------------------------------
Total                                                                         3.2 MB/s |  25 MB     00:07
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : apr-1.3.9-5.el6_2.x86_64                                                                  1/21
  Installing : apr-util-1.3.9-3.el6_0.1.x86_64                                                           2/21
  Installing : sysvinit-tools-2.87-6.dsf.el6.x86_64                                                      3/21
  Installing : php-common-5.3.3-46.el6_7.1.x86_64                                                        4/21
  Installing : httpd-tools-2.2.15-47.el6.centos.4.x86_64                                                 5/21
  Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                      6/21
  Installing : mailcap-2.1.31-2.el6.noarch                                                               7/21
  Installing : redhat-logos-60.0.14-12.el6.centos.noarch                                                 8/21
  Installing : hwdata-0.233-14.1.el6.noarch                                                              9/21
  Installing : dbus-glib-0.86-6.el6.x86_64                                                              10/21
  Installing : policycoreutils-2.0.83-24.el6.x86_64                                                     11/21
  Installing : iptables-1.4.7-16.el6.x86_64                                                             12/21
  Installing : iproute-2.6.32-45.el6.x86_64                                                             13/21
  Installing : iputils-20071127-20.el6.x86_64                                                           14/21
  Installing : util-linux-ng-2.17.2-12.18.el6.x86_64                                                    15/21
install-info: No such file or directory for /usr/share/info/ipc.info
  Installing : initscripts-9.03.49-1.el6.centos.4.x86_64                                                16/21
  Installing : udev-147-2.63.el6_7.1.x86_64                                                             17/21
udevd[94]: error setting /sys/class/firmware/timeout: No such file or directory

  Installing : httpd-2.2.15-47.el6.centos.4.x86_64                                                      18/21
  Installing : libedit-2.11-4.20080712cvs.1.el6.x86_64                                                  19/21
  Installing : php-cli-5.3.3-46.el6_7.1.x86_64                                                          20/21
  Installing : php-5.3.3-46.el6_7.1.x86_64                                                              21/21
  Verifying  : php-common-5.3.3-46.el6_7.1.x86_64                                                        1/21
  Verifying  : policycoreutils-2.0.83-24.el6.x86_64                                                      2/21
  Verifying  : iproute-2.6.32-45.el6.x86_64                                                              3/21
  Verifying  : libedit-2.11-4.20080712cvs.1.el6.x86_64                                                   4/21
  Verifying  : httpd-tools-2.2.15-47.el6.centos.4.x86_64                                                 5/21
  Verifying  : util-linux-ng-2.17.2-12.18.el6.x86_64                                                     6/21
  Verifying  : sysvinit-tools-2.87-6.dsf.el6.x86_64                                                      7/21
  Verifying  : dbus-glib-0.86-6.el6.x86_64                                                               8/21
  Verifying  : hwdata-0.233-14.1.el6.noarch                                                              9/21
  Verifying  : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                     10/21
  Verifying  : apr-1.3.9-5.el6_2.x86_64                                                                 11/21
  Verifying  : initscripts-9.03.49-1.el6.centos.4.x86_64                                                12/21
  Verifying  : redhat-logos-60.0.14-12.el6.centos.noarch                                                13/21
  Verifying  : udev-147-2.63.el6_7.1.x86_64                                                             14/21
  Verifying  : iptables-1.4.7-16.el6.x86_64                                                             15/21
  Verifying  : php-5.3.3-46.el6_7.1.x86_64                                                              16/21
  Verifying  : iputils-20071127-20.el6.x86_64                                                           17/21
  Verifying  : httpd-2.2.15-47.el6.centos.4.x86_64                                                      18/21
  Verifying  : mailcap-2.1.31-2.el6.noarch                                                              19/21
  Verifying  : php-cli-5.3.3-46.el6_7.1.x86_64                                                          20/21
  Verifying  : apr-util-1.3.9-3.el6_0.1.x86_64                                                          21/21

Installed:
  php.x86_64 0:5.3.3-46.el6_7.1

Dependency Installed:
  apr.x86_64 0:1.3.9-5.el6_2                            apr-util.x86_64 0:1.3.9-3.el6_0.1
  apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1                dbus-glib.x86_64 0:0.86-6.el6
  httpd.x86_64 0:2.2.15-47.el6.centos.4                 httpd-tools.x86_64 0:2.2.15-47.el6.centos.4
  hwdata.noarch 0:0.233-14.1.el6                        initscripts.x86_64 0:9.03.49-1.el6.centos.4
  iproute.x86_64 0:2.6.32-45.el6                        iptables.x86_64 0:1.4.7-16.el6
  iputils.x86_64 0:20071127-20.el6                      libedit.x86_64 0:2.11-4.20080712cvs.1.el6
  mailcap.noarch 0:2.1.31-2.el6                         php-cli.x86_64 0:5.3.3-46.el6_7.1
  php-common.x86_64 0:5.3.3-46.el6_7.1                  policycoreutils.x86_64 0:2.0.83-24.el6
  redhat-logos.noarch 0:60.0.14-12.el6.centos           sysvinit-tools.x86_64 0:2.87-6.dsf.el6
  udev.x86_64 0:147-2.63.el6_7.1                        util-linux-ng.x86_64 0:2.17.2-12.18.el6

Complete!
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2016-4-17 18:06
crono  新米   投稿数: 5
arashi1977さん

いつもありがとうございます。
引用も載せてくださり、理解できました!

  >フォーラム検索へ


Copyright (c) 2020 Ping-t All rights reserved.
ログイン
ユーザ名 or E-Mailアドレス:

パスワード:







Contact

LPI-Japan Logo

LPI Logo