I was doing a "yum -y update" on a CentOS 4.5 system to get to 4.6 when my system froze. I couldn't ping it nor switch to an alternate console. It was completely frozen. The only recourse was to cycle the power. So I did that, and now when I try to do a "yum update" I get the following error:
[many package header downloads deleted] tkinter-2.3.4-14.4.el4_6. 100% |=========================| 21 kB 00:00 ---> Package tkinter.i386 0:2.3.4-14.4.el4_6.1 set to be updated ---> Downloading header for oprofile to pack into transaction set. oprofile-0.8.1-33.i386.rp 100% |=========================| 20 kB 00:00 ---> Package oprofile.i386 0:0.8.1-33 set to be updated --> Running transaction check --> Processing Conflict: python-devel conflicts python < 2.3.4-14.4.el4_6.1 --> Processing Dependency: kdebase = 6:3.3.1-6.el4 for package: kdebase-devel --> Processing Dependency: httpd = 2.0.52-32.3.ent.centos4 for package: httpd-manual --> Processing Dependency: xorg-x11-devel = 6.8.2-1.EL.31 for package: xorg-x11-deprecated-libs-devel --> Processing Dependency: rpm = 4.3.3-22_nonptl for package: rpm-build --> Processing Dependency: xorg-x11-deprecated-libs = 6.8.2-1.EL.31 for package: xorg-x11-deprecated-libs-devel --> Processing Dependency: httpd = 2.0.52-32.3.ent.centos4 for package: httpd-suexec --> Processing Dependency: rpm = 4.3.3-22_nonptl for package: rpm-devel --> Finished Dependency Resolution Error: python-devel conflicts with python < 2.3.4-14.4.el4_6.1 Error: Missing Dependency: kdebase = 6:3.3.1-6.el4 is needed by package kdebase-devel Error: Missing Dependency: httpd = 2.0.52-32.3.ent.centos4 is needed by package httpd-manual Error: Missing Dependency: xorg-x11-devel = 6.8.2-1.EL.31 is needed by package xorg-x11-deprecated-libs-devel Error: Missing Dependency: rpm = 4.3.3-22_nonptl is needed by package rpm-build Error: Missing Dependency: xorg-x11-deprecated-libs = 6.8.2-1.EL.31 is needed by package xorg-x11-deprecated-libs-devel Error: Missing Dependency: httpd = 2.0.52-32.3.ent.centos4 is needed by package httpd-suexec Error: Missing Dependency: rpm = 4.3.3-22_nonptl is needed by package rpm-devel
From the attached log file, you can see that yum was able to install/ update 120 packages before it crashed. Any ideas on how to recover from this state?
Alfred
On Wed, Dec 19, 2007 at 02:14:51PM -0500, Alfred von Campe alleged:
I was doing a "yum -y update" on a CentOS 4.5 system to get to 4.6 when my system froze. I couldn't ping it nor switch to an alternate console. It was completely frozen. The only recourse was to cycle the power. So I did that, and now when I try to do a "yum update" I get the following error:
You have dup rpms installed because of the crash in the middle of the rpm transaction.
You need to go through and remove the dups.
Something like this will help find the dups: rpm -qa --qf '%{NAME}.%{ARCH}\n' | sort | uniq -c | sort -n
Alfred von Campe wrote:
I was doing a "yum -y update" on a CentOS 4.5 system to get to 4.6 when my system froze. I couldn't ping it nor switch to an alternate console. It was completely frozen. The only recourse was to cycle the power. So I did that, and now when I try to do a "yum update" I get the following error:
install yum-utils, and run package-cleanup, use that to clear the rpmdb out and rerun the yum update
I was in meetings most of the afternoon yesterday, so I didn't get a chance to try Garrick's solution until this morning. I made the list of duplicate RPMs, and it contained over 100 RPMs. It then occurred to me that I only needed to remove the RPMs that are causing the conflict to get yum to finish the update. But then along came Karanbir's email, and using "package-cleanup --problems" narrowed down the list even further. I did an "rpm -q" for each package identified by "package-cleanup --problems" followed by an "rpm -e" of the higher versioned RPM. Then "yum update" worked just fine.
However, I still have a lot of duplicate RPMs installed. I don't think I can do an "rpm -e" on the lower versioned RPM, since many (if not all) of the files are in the newer RPM as well. Maybe I'll have to do an "rpm -e --justdb" for each lower versioned RPM to fix this...
In any event, thanks for your help. This list is great.
Alfred
On Dec 20, 2007 8:13 AM, Alfred von Campe alfred@von-campe.com wrote:
However, I still have a lot of duplicate RPMs installed. I don't think I can do an "rpm -e" on the lower versioned RPM, since many (if not all) of the files are in the newer RPM as well. Maybe I'll have to do an "rpm -e --justdb" for each lower versioned RPM to fix this...
In any event, thanks for your help. This list is great.
Alfred
Follow this forum thread:
http://www.centos.org/modules/newbb/viewtopic.php?topic_id=10139&forum=2...
The command in there (note #6) may work for you as well.
Akemi
Akemi:
Follow this forum thread:
http://www.centos.org/modules/newbb/viewtopic.php? topic_id=10139&forum=27&post_id=32373#forumpost32373
The command in there (note #6) may work for you as well.
Excellent, thanks for the pointer. However, in my case I want to clean out the older packages since already I successfully completed the "yum update" to 4.6, right? So it's just a matter of changing the "head" to "tail" on that command so it looks like this:
for file in `rpm -qa --queryformat="%{NAME} %{ARCH}\n" | sort | uniq -c | grep -v " 1 " | \ cut -c 9- | cut -d" " -f1`; do rpm -q --last $file | tail -1 | cut -d" " -f1; done | \ grep -v kernel | grep -v gpg-pubkey | xargs rpm -e --justdb -- nodeps
Alfred
On Dec 20, 2007 9:47 AM, Alfred von Campe alfred@von-campe.com wrote:
Akemi:
Follow this forum thread:
http://www.centos.org/modules/newbb/viewtopic.php? topic_id=10139&forum=27&post_id=32373#forumpost32373
The command in there (note #6) may work for you as well.
Excellent, thanks for the pointer. However, in my case I want to clean out the older packages since already I successfully completed the "yum update" to 4.6, right? So it's just a matter of changing the "head" to "tail" on that command so it looks like this:
for file in `rpm -qa --queryformat="%{NAME} %{ARCH}\n" | sort |
uniq -c | grep -v " 1 " | \ cut -c 9- | cut -d" " -f1`; do rpm -q --last $file | tail -1 | cut -d" " -f1; done | \ grep -v kernel | grep -v gpg-pubkey | xargs rpm -e --justdb -- nodeps
Alfred
Replacing the head with a tail should give you the "oldest" one, yes.
Akemi