所以我有一个必须硬关闭的虚拟机。我无法让错误停止。
CentOS 7.x 最新
[user@asm-dmz01 ~]$ sudo yum-complete-transaction --cleanup-only
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirrors.wvstateu.edu
* epel: mirror.cs.princeton.edu
* extras: mirror.riverfrontnetworks.com
* updates: mirror.stjschools.org
Cleaning up unfinished transaction journals
Cleaning up 2016-05-18.11:05.17
[user@asm-dmz01 ~]$ sudo yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirrors.wvstateu.edu
* epel: mirror.cs.princeton.edu
* extras: mirror.riverfrontnetworks.com
* updates: mirror.stjschools.org
Resolving Dependencies
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-106.el7_2.4 will be updated
--> Processing Dependency: glibc-common = 2.17-106.el7_2.4 for package: glibc-2.17-106.el7_2.4.x86_64
---> Package glibc-common.x86_64 0:2.17-106.el7_2.6 will be an update
--> Finished Dependency Resolution
Error: Package: glibc-2.17-106.el7_2.4.x86_64 (@updates)
Requires: glibc-common = 2.17-106.el7_2.4
Removing: glibc-common-2.17-106.el7_2.4.x86_64 (@updates)
glibc-common = 2.17-106.el7_2.4
Updated By: glibc-common-2.17-106.el7_2.6.x86_64 (updates)
glibc-common = 2.17-106.el7_2.6
Available: glibc-common-2.17-105.el7.x86_64 (base)
glibc-common = 2.17-105.el7
Available: glibc-common-2.17-106.el7_2.1.x86_64 (updates)
glibc-common = 2.17-106.el7_2.1
You could try using --skip-broken to work around the problem
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
glibc-2.17-106.el7_2.6.x86_64 is a duplicate with glibc-2.17-106.el7_2.4.x86_64
glibc-2.17-106.el7_2.6.x86_64 has missing requires of glibc-common = ('0', '2.17', '106.el7_2.6')
[user@asm-dmz01 ~]$ sudo yum check
Loaded plugins: fastestmirror
glibc-2.17-106.el7_2.6.x86_64 is a duplicate with glibc-2.17-106.el7_2.4.x86_64
glibc-2.17-106.el7_2.6.x86_64 has missing requires of glibc-common = ('0', '2.17', '106.el7_2.6')
Error: check all
[user@asm-dmz01 ~]$
[user@asm-dmz01 ~]$
[user@asm-dmz01 ~]$
[user@asm-dmz01 ~]$ ping 10.150.1.63
PING 10.150.1.63 (10.150.1.63) 56(84) bytes of data.
64 bytes from 10.150.1.63: icmp_seq=1 ttl=64 time=0.695 ms
64 bytes from 10.150.1.63: icmp_seq=2 ttl=64 time=0.416 ms
^C
--- 10.150.1.63 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.416/0.555/0.695/0.141 ms
[user@asm-dmz01 ~]$
答案1
最后几行解释了这个问题。您关闭了正在附加/更改 rpmdb 的虚拟机。您必须重新构建 rpmdb 才能解决该问题。如果由于某种原因您没有 /var/lib/rpm 的备份,则必须手动进行备份。大量的手册、解释和帖子描述了如何操作。