[CentOS] Re: Broken upgrade to 5.2 {solved - I hope}

Scott Silva ssilva at sgvwater.com
Wed Jun 25 19:01:10 UTC 2008


on 6-25-2008 5:27 AM Ian Blackwell spake the following:
> Thanks to all that offered advice to help solve this for me.  Here's a 
> round up for those that may follow in similarly ill-fated foot-steps.
> 
> 1. Don't update/upgrade remotely without using "screen".  Dropping the 
> ssh session caused yum to die inelegantly, with duplicate packages in 
> the RPM database.
> 2. Analysing the output from
>    /bin/rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' | sort
> led me to erase almost 30 new packages that appeared to be duplicates of 
> existing packages.  This wasn't without problems though, because I used 
> this command:-
>    yum erase libgcc-4.1.2-42.el5.i386
> to remove the duplication noticed here:-
>    libgcc-4.1.2-14.el5.i386.rpm
>    libgcc-4.1.2-42.el5.i386.rpm
> 3. This broke the machine badly, and caused yum to stop working 
> completely with missing libgcc_s.so.1 being reported as the cause.  This 
> also effected other programs, e.g. man wasn't working either.  Anyway, 
> long story short, I booted from the 5.1 DVD in rescue mode.  I was 
> reluctant to reboot the box in a half upgraded state, but was forced 
> into this due to the corrupt libgcc problem.  I then forced the 
> reinstallation of libgcc-4.1.2-14.el5.i386 from the DVD using:-
>    rpm -ivh --force --root /mnt/sysimage libgcc-4.1.2-14.el5.i386.rpm
> This worked OK and the machine rebooted without a problem (what a relief).
> 4. Next I tried the yum -y upgrade process again (from the console this 
> time), and to my enormous delight, it downloaded the packages I had 
> removed earlier and then passed all transaction tests and started to 
> process the 577 steps left to upgrade to 5.2.
> 5. I think there may still be some duplicates, which I'll check for 
> after the upgrade has completed.  I didn't get all the way through my 
> analysis of the duplicate package list because of the broken libgcc 
> issue.  Having resolved this with the rescue boot, I took a punt on 
> "having done enough" and restarted "yum upgrade".  Since it worked, I 
> decided against interrupting it with the view to a subsequent 
> reconciliation.
> 
> All being well, I should have an upgraded machine fairly soon.
> 
> Thanks again for your prompt and enlightened assistance 8-)
> 
> Ian
Something I used on a 4.3 borked upgrade is the following;
---code---
#!/bin/bash


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 gpg-pubkey | xargs rpm -e
  --justdb --nodeps 2> /tmp/dupes

---code---

Watch the linewraps.

Oh hell, I'll attach it also for posterity!


-- 
MailScanner is like deodorant...
You hope everybody uses it, and
you notice quickly if they don't!!!!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: find_dupes.tgz
Type: application/x-compressed
Size: 309 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20080625/26cbf5b8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://lists.centos.org/pipermail/centos/attachments/20080625/26cbf5b8/attachment.sig>


More information about the CentOS mailing list