Murphy
What's quite unlikely in these times? A power failure.
What's even more unlikely? Me upgrading at the exact minute of the power failure to the first release candidate of Mandriva 2010.
System didn't boot at first, but that could be fixed by a straightforward repair of grub. After that, it became obvious that all further updates were complicated by the fact that the rpm database contained more than 600 duplicates, i.e., the system believed to have the same package installed in both 2009.1 and 2010.0 version. An 'rpm --rebuilddb' didn't help. What to do?
rpm -qa --queryformat '%{NAME}-%{VERSION}\n' | sort | uniq -d > duplicates_0 while read pkg; do rpm -q "$pkg" > duplicates_1; done < duplicates_0 sed -i '/2010/d' duplicates_1 while read pkg; do urpme "$pkg" && echo "$pkg"; done < duplicates_1
Instead of the sed command, you can also load duplicates_1 in vim, and:
:g/2010/delete ZZ