我遇到了错误,我认为使用 coreutils,yum 不会更新。这是我在运行时看到的精简输出yum update
:
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package.
--> Running transaction check
---> Package PyYAML.x86_64 0:3.10-3.el6 will be updated
---> Package PyYAML.x86_64 0:3.10-3.1.el6 will be an update
... more of the same, and then:
--> Processing Dependency: coreutils = 8.4-31.el6_5.2 for package: coreutils-libs-8.4-31.el6_5.2.x86_64
---> Package coreutils.x86_64 0:8.4-37.el6 will be an update
... then more of the same --> Finished Dependency Resolution
--> Running transaction check
---> Package coreutils.x86_64 0:8.4-31.el6_5.2 will be updated
--> Processing Dependency: coreutils = 8.4-31.el6_5.2 for package: coreutils-libs-8.4-31.el6_5.2.x86_64
---> Package kernel.x86_64 0:2.6.32-431.17.1.el6 will be erased
--> Finished Dependency Resolution
Error: Package: coreutils-libs-8.4-31.el6_5.2.x86_64 (@updates)
Requires: coreutils = 8.4-31.el6_5.2
Removing: coreutils-8.4-31.el6_5.2.x86_64 (@updates)
coreutils = 8.4-31.el6_5.2
Updated By: coreutils-8.4-37.el6.x86_64 (base)
coreutils = 8.4-37.el6
You could try using --skip-broken to work around the problem
** Found 71 pre-existing rpmdb problem(s), 'yum check' output follows:
audit-libs-2.3.7-5.el6.x86_64 is a duplicate with audit-libs-2.2-4.el6_5.x86_64
audit-libs-python-2.3.7-5.el6.x86_64 is a duplicate with audit-libs-python-2.2-4.el6_5.x86_64
... then lots more like the above duplicate
我有另一台服务器(几乎)与此相同(它们是负载平衡的并且从同一个图像工作)并且没有遇到同样的问题。可能是什么问题,我应该如何最好地进行?
更新:
我也运行yum-complete-transaction
失败并说它已重命名事务文件。它仍然说有一个不完整的交易,但现在当我运行它时会发生这种情况:
[root@nico ~]# yum-complete-transaction
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* webtatic: uk.repo.webtatic.com
drivesrvr | 951 B 00:00
There are 1 outstanding transactions to complete. Finishing the most recent one
The remaining transaction had 252 elements left to run
... lots of:
Package name-1.23.x8x_64 already installed and latest version
...
--> Running transaction check
... lots of entries like this:
---> Package PyYAML.x86_64 0:3.10-3.el6 will be updated
... and this:
---> Package PyYAML.x86_64 0:3.10-3.1.el6 will be an update
... and this:
---> Package audit-libs.x86_64 0:2.2-4.el6_5 will be erased
Killed
然后它突然停在这Killed
条线上。
我尝试yum update --skip-broken
下一步运行:
[root@nico ~]# yum update --skip-broken
Freeing read locks for locker 0x7d: 28940/139976145426176
Freeing read locks for locker 0x7f: 28940/139976145426176
Freeing read locks for locker 0x80: 28940/139976145426176
Freeing read locks for locker 0x81: 28940/139976145426176
Freeing read locks for locker 0x82: 28940/139976145426176
Loaded plugins: downloadonly, fastestmirror, replace
Setting up Update Process
Loading mirror speeds from cached hostfile
* webtatic: uk.repo.webtatic.com
drivesrvr | 951 B 00:00
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
... lots of will be updated/will be an update/etc, then:
--> Processing Dependency: coreutils = 8.4-31.el6_5.2 for package: coreutils-libs-8.4-31.el6_5.2.x86_64
然后还有几个Running transaction check:
s,以及Processing Dependency: coreutils =...
更多条目中的willy be updated/willbe an update
条目。然后:
Packages skipped because of dependency problems:
coreutils-8.4-37.el6.x86_64 from base
Dependencies Resolved
然后我会看到一个包含包列表的表格Installing:
,Updating:
最后有一个摘要:
Install 2 Package(s)
Upgrade 79 Package(s)
Remove 1 Package(s)
然后它会下载所有包(81/81 成功),最后显示:
Total 3.0 MB/s | 115 MB 00:37
Running rpm_check_debug
Killed
更新 2:
我也跑了yum clean all
,在那里也遇到了一些问题。我找到了一些删除__db*
文件并重试的建议:
[root@nico ~]# yum clean all
rpmdb: Thread/process 29404/139880514733824 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
[root@nico ~]# rm -f /var/lib/rpm/__db*
[root@nico ~]# yum clean all
Loaded plugins: downloadonly, fastestmirror, replace
Cleaning repos: base drivesrvr epel extras ius newrelic percona-release-noarch percona-release-x86_64 rackspace updates webtatic
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@nico ~]# yum clean all
Loaded plugins: downloadonly, fastestmirror, replace
Cleaning repos: base drivesrvr epel extras ius newrelic percona-release-noarch percona-release-x86_64 rackspace updates webtatic
Cleaning up Everything
[root@nico ~]#
更新 3:
跑的时候尾/var/log/messages
了,看到很多输出yum-complete-transaction
,最后两行是:
Nov 14 08:19:47 nico kernel: Out of memory: Kill process 30995 (yum-complete-tr) score 149 or sacrifice child
Nov 14 08:19:47 nico kernel: Killed process 30995, UID 0, (yum-complete-tr) total-vm:641952kB, anon-rss:181420kB, file-rss:4kB
所以大概这表明它与记忆有关。如果是这样,这是需要更多 RAM 的情况,还是我需要调查另一个问题?
yum
死亡的通常原因Killed
是系统内存不足。从您的日志看来,您有一个 Amazon t1.micro 实例,或者类似大小的实例,并且没有任何交换空间。这种有限的内存量通常不足以完成大量的软件包安装/更新。
要解决此问题,请执行以下任一操作:
关闭正在运行的服务,直到您有足够的内存来完成 yum 事务。
或者...
向您的实例添加交换文件或交换临时存储。
然后您应该能够完成您的 yum 交易。
最后,要清除以前失败更新中的软件包问题,请尝试
在执行任何其他更新之前。
类似的问题 - 和我的修复。我的内存也有问题,所以不得不升级VPS的内存。然后我做了一个 yum 更新——当然得到了上面的错误。所以查看了失败,并注意到发生了什么是 Yum 安装(嗯,开始安装)最新的 coreutils - 版本 37,而我仍然有 31 位。所以首先,删除版本 37,然后清理然后运行 yum update再次。
这导致“31”版本可以干净地“更新”。请看下面的作品:
运行
yum remove coreutils-libs-8.4-37.el6.x86_64
:清理使用
yum clean all
:做包列表刷新
yum update
:-苏普。
试试
you update --skip-broken
这会跳过损坏的包(你可以稍后处理它们),yum clean all
在做任何事情之前运行可能是个好主意。过滤掉您引用的无关信息,并且
yum
已经尝试帮助您:你已经试过了吗?
试一试
yum 降级包名
不知道为什么,但它更新了,或者至少它为我做了 tcpdump 包。从版本 tcpdump-4.5.1-2.el7.x86_64 到 tcpdump-4.7.4-1_ESG_ring.x86_64 这正是我想要的。