2015-04-14 39 views
1

我想通过'rpm'命令安装一些RPM,类似于'yum install'完成任务的方式。如何通过rpm复制yum命令?

我已经下载了RPM,并通过命令

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

然而,当我发出命令所有需要的依赖

rpm -ivh *.rpm 

的RPM安装失败理由失败相关性,如以下几点:

[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 
+1

您似乎已经下载了较旧/不正确的软件包。据推测,软件包是针对python 2.4而不是python 2.6构建的,与当前安装的软件包一样。 –

+1

'rpm -Uvh * .rpm' – arkascha

+0

好消息:如果您要求它安装相同的RPM文件(例如,通过'yum localinstall * .rpm'),'yum'会表达等效的错误,所以您已经实现了目标。 –

回答

1

您应该使用-U标志(升级),而不是-i安装):

rpm -Uvh *.rpm 

的原因是包间,你下载的是一些已经在本地安装,但在旧版本。这些软件包在使用-i时不会升级,因此依赖关系会冲突出现未满足的依赖关系。

0

尝试--aid开关

rpm -ivh --aid 

注:请确保您有rpmdb-redhat包安装。

+0

我无法在我的回购协议中找到。 – Setheron

+0

如果您没有'RHN'帐户,那么您可以从第三方获得它们,例如http://rpm.pbone.net/index.php3/stat/4/idpl/2394489/dir/redhat_6.x/ COM/rpmdb中,红帽,6.1-0.19990924.i386.rpm.html' – Satish