我有一个 CentOS 6.4 机器,里面有很多其他 RPM。
我想用 libpng12.devel 替换 libpng-devel。如果我这样做,rpm -e libpng-devel
我会得到以下结果:
error: Failed dependencies:
pkgconfig(libpng) is needed by (installed) cairo-devel-1.10.2-7.el6.x86_64
pkgconfig(libpng15) is needed by (installed) gdk-pixbuf2-devel-2.26.1-1.el6.x86_64
libpng-devel is needed by (installed) cairo-devel-1.10.2-7.el6.x86_64
libpng-devel is needed by (installed) gtk2-devel-2.24.10-1.el6.x86_64
libpng-devel(x86-64) = 2:1.5.13-2.el6 is needed by (installed) libpng-static-2:1.5.13-2.el6.x86_64
删除这些会让我掉进兔子洞。
我尝试 yum 降级并得到以下信息:
[mono@localhost ~]$ sudo yum downgrade libpng
Loaded plugins: fastestmirror
Setting up Downgrade Process
Loading mirror speeds from cached hostfile
* base: mirror.net.cen.ct.gov
* extras: mirror.dattobackup.com
* rpmforge: repoforge.mirror.constant.com
* updates: mirror.umd.edu
Resolving Dependencies
--> Running transaction check
---> Package libpng.x86_64 2:1.2.49-1.el6_2 will be a downgrade
---> Package libpng.x86_64 2:1.5.13-2.el6 will be erased
--> Finished Dependency Resolution
Error: Package: gdk-pixbuf2-devel-2.26.1-1.el6.x86_64 (installed)
Requires: libpng15.so.15()(64bit)
Removing: 2:libpng-1.5.13-2.el6.x86_64 (installed)
libpng15.so.15()(64bit)
Downgraded By: 2:libpng-1.2.49-1.el6_2.x86_64 (base)
Not found
Error: Package: 2:libpng-devel-1.5.13-2.el6.x86_64 (installed)
Requires: libpng(x86-64) = 2:1.5.13-2.el6
Removing: 2:libpng-1.5.13-2.el6.x86_64 (installed)
libpng(x86-64) = 2:1.5.13-2.el6
Downgraded By: 2:libpng-1.2.49-1.el6_2.x86_64 (base)
libpng(x86-64) = 2:1.2.49-1.el6_2
Error: Package: 2:libpng-devel-1.5.13-2.el6.x86_64 (installed)
Requires: libpng15.so.15()(64bit)
Removing: 2:libpng-1.5.13-2.el6.x86_64 (installed)
libpng15.so.15()(64bit)
Downgraded By: 2:libpng-1.2.49-1.el6_2.x86_64 (base)
Not found
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[mono@localhost ~]$
降级其他人也让我陷入了类似的困境。
我尝试了 localinstall/localupdate,但它们似乎也不起作用:
[mono@localhost ~]$ sudo yum --nogpgcheck localinstall ~/rpmbuild/RPMS/x86_64/libpng12-devel-1.2.50-3.el6.x86_64.rpm
Loaded plugins: fastestmirror
Setting up Local Package Process
Examining /home/mono/rpmbuild/RPMS/x86_64/libpng12-devel-1.2.50-3.el6.x86_64.rpm: libpng12-devel-1.2.50-3.el6.x86_64
Marking /home/mono/rpmbuild/RPMS/x86_64/libpng12-devel-1.2.50-3.el6.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
* base: mirror.net.cen.ct.gov
* extras: mirror.dattobackup.com
* rpmforge: repoforge.mirror.constant.com
* updates: mirror.umd.edu
Resolving Dependencies
--> Running transaction check
---> Package libpng12-devel.x86_64 0:1.2.50-3.el6 will be installed
--> Processing Conflict: libpng12-devel-1.2.50-3.el6.x86_64 conflicts libpng-devel
No package matched to upgrade: libpng12-devel
--> Finished Dependency Resolution
Error: libpng12-devel conflicts with 2:libpng-devel-1.5.13-2.el6.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[mono@localhost ~]$ sudo yum --nogpgcheck localupdate ~/rpmbuild/RPMS/x86_64/libpng12-devel-1.2.50-3.el6.x86_64.rpm
Loaded plugins: fastestmirror
Setting up Local Package Process
Examining /home/mono/rpmbuild/RPMS/x86_64/libpng12-devel-1.2.50-3.el6.x86_64.rpm: libpng12-devel-1.2.50-3.el6.x86_64
Package libpng12-devel not installed, cannot update it. Run yum install to install it instead.
Nothing to do
[mono@localhost ~]$
有什么方法可以删除一个 rpm 并在同一命令中添加另一个 rpm 吗?是否存在多命令 RPM 事务? RPM 交易似乎用于历史审计,所以我想我在谷歌上搜索了错误的词。我需要在我的系统上大量交换这些 RPM,因此如果有一种方法可以通过修改 rpm 规范并重建它来链接它们,那也是可以接受的。
答案1
您通常不会先进行删除 ( -e
),然后再进行安装。这将推动 RPM 删除任何依赖于此 RPM 的应用程序。相反,您想要进行升级。
$ rpm -Uvh libpng12-devel
如果这个包实际上是“libpng”升级的一个下降,它将作为一个单一的移动来完成删除和安装,从而安抚依赖关系。
使用百胜
我也经常yum
这样做,它不仅可以帮助您解决常规 RPM 问题,还可以解决诸如此类的棘手问题。使用这个命令:
$ yum update libpng12-devel
您还可以使用以下命令安装本地 RPM yum
:
$ yum --nogpgcheck localinstall libpng12-devel....rpm
这通常会为您提供有关如何最好地应对这些类型的棘手包管理操作的建议。
答案2
是的,libpng
一团糟。以下是一些提示:
首先,进行健全性检查:
package-cleanup --cleandupes
交换通常有效,但可能需要一些实验:
yum swap -- install libpng12 libpng12-devel -- remove libpng libpng-devel
如果你感觉很狡猾,你可以随时跳过 multilib 检查:
--setopt=protected_multilib=false