1
votes

I'd like to install some RPMs via the 'rpm' command similarly to how 'yum install' accomplishes the task.

I've downloaded the RPM and all required dependencies via the command

yum install --downloadonly --downloaddir=. <package>

However when I issue the command

rpm -ivh *.rpm

The RPMs fail to install citing fail dependencies such as the following:

[18:45:05][root][~/test]$ rpm -ivh *
warning: authconfig-6.1.12-13.22.amzn1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 21c0f39f: NOKEY
error: Failed dependencies:
        dbus-python <= 0.83.0-6.1.11.amzn1 is obsoleted by dbus-python26-0.83.0-6.1.13.amzn1.x86_64
        yum-updatesd <= 1:0.9-13.14.amzn1 conflicts with dbus-python27-0.83.0-6.1.13.amzn1.x86_64
        dbus-python <= 0.83.0-6.1.11.amzn1 conflicts with dbus-python27-0.83.0-6.1.13.amzn1.x86_64
        yum-updatesd <= 1:0.9-13.14.amzn1 conflicts with gamin-python-0.1.10-16.14.amzn1.x86_64
        newt-python <= 0.52.11-3.7.amzn1 is obsoleted by newt-python26-0.52.11-3.11.amzn1.x86_64
        yum-updatesd <= 1:0.9-13.14.amzn1 conflicts with pygobject2-2.20.0-5.14.amzn1.x86_64
        authconfig <= 6.1.12-13.17.amzn1 conflicts with python26-2.6.9-1.80.amzn1.x86_64
        gamin-python <= 0.1.10-9.8.amzn1 conflicts with python26-2.6.9-1.80.amzn1.x86_64
        mcstrans <= 0.3.1-4.7.amzn1 conflicts with python26-2.6.9-1.80.amzn1.x86_64
        python-urlgrabber <= 3.9.1-9.10.amzn1 conflicts with python26-2.6.9-1.80.amzn1.x86_64
        yum <= 3.4.3-137.51.amzn1 conflicts with python26-2.6.9-1.80.amzn1.x86_64
        yum-updatesd <= 1:0.9-13.14.amzn1 conflicts with python26-2.6.9-1.80.amzn1.x86_64
        python = 1:2.6-2.26.amzn1 is obsoleted by python26-2.6.9-1.80.amzn1.x86_64
        python-iniparse <= 0.3.1-2.1.7.amzn1 is obsoleted by python26-iniparse-0.3.1-2.1.9.amzn1.noarch
        python-pycurl <= 7.19.0-17.9.amzn1 is obsoleted by python26-pycurl-7.19.0-17.12.amzn1.x86_64
        pygpgme <= 0.1-18.20090824bzr68.8.amzn1 is obsoleted by python26-pygpgme-0.3-9.12.amzn1.x86_64
        pyliblzma <= 0.5.3-11.4.amzn1 is obsoleted by python26-pyliblzma-0.5.3-11.6.amzn1.x86_64
        pyxattr <= 0.5.0-1.4.amzn1 is obsoleted by python26-pyxattr-0.5.0-1.6.amzn1.x86_64
        python-urlgrabber <= 3.9.1-9.10.amzn1 is obsoleted by python26-urlgrabber-3.9.1-9.13.amzn1.noarch
        python = 1:2.6-2.26.amzn1 conflicts with python27-2.7.9-4.115.amzn1.x86_64
        python-urlgrabber <= 3.9.1-9.10.amzn1 conflicts with python27-urlgrabber-3.9.1-9.13.amzn1.noarch
        rpm-python <= 4.11.2-2.60.amzn1 is obsoleted by rpm-python26-4.11.2-2.64.amzn1.x86_64
        yum-updatesd <= 1:0.9-13.14.amzn1 conflicts with yum-3.4.3-137.57.amzn1.noarch
        yum-plugin-priorities <= 1.1.31-18.17.amzn1 conflicts with yum-3.4.3-137.57.amzn1.noarch
        yum-plugin-upgrade-helper <= 1.1.31-18.17.amzn1 conflicts with yum-3.4.3-137.57.amzn1.noarch
        yum <= 3.4.3-137.51.amzn1 conflicts with yum-metadata-parser-1.1.4-8.12.amzn1.x86_64
        rpm-python <= 4.11.2-2.63.amzn1 is obsoleted by yum-python26-3.4.3-137.57.amzn1.noarch
2
You appear to have downloaded older/incorrect packages. Presumably packages built against python 2.4 instead of python 2.6 as the currently installed packages are. - Etan Reisner
Good news: yum would express equivalent errors if you asked it to install the same RPM files (via, say, yum localinstall *.rpm), so you've achieved your goal. - John Bollinger
@arkascha- Even that won't work! Actually, he'll have to create a fresh repo and then finally have to use rpm. - Am_I_Helpful
yum's most important value-add relative to rpm is its automatic analysis and retrieval of RPM dependencies. rpm has nothing like it. You can instruct rpm to install multiple packages in one command, in which case it will order them appropriately to satisfy dependencies, but it's still up to you to find and provide appropriate RPM files relative to the other packages already installed on the system. You failed to do so. - John Bollinger
@arkascha had it! I was doing the 'i' switch and not the 'U'. /palmface! - Setheron

2 Answers

1
votes

You should use the -U flag (upgrade) instead of -i (install):

rpm -Uvh *.rpm

Reason is that among the packages you downloaded are some already locally installed, though in older versions. Those packages won't get upgraded when using -i, thus the dependency conflicts about unmet dependencies.

0
votes

Try --aid switch

rpm -ivh --aid

Notes: make sure you have rpmdb-redhat package install.