[olug] upgrading to Fedora 20 via yum

Lou Duchez lou at paprikash.com
Mon Dec 30 18:18:05 UTC 2013


New Fedora, time to upgrade the servers again, using yum.

Fedora comes with a utility called "fedora-upgrade", it's a script that 
does all the recommended and required steps.  It works well, but 
personally I have stopped using it: there is one drawback to the script, 
and that is it tries to update everything all at once in one 
uninterrupted (and uninterruptible) process.  In theory that's great!  I 
updated one of my servers successfully that way.  But the next server 
went kind of disastrous, because I was SSH'd into the box to do the 
update, and the network connection dropped in the middle of it all, 
making a big mess.*

So I have updated the rest of my servers the old way, and it's been just 
fine.  Steps:

1)    Visit http://fedoraproject.org/wiki/YumUpgradeFaq to see what 
notes and instructions they have.

2)    "yum update" followed by "yum clean all" to make sure your server 
is as up-to-date as it can be.

3)    "yum --releasever=[version] update kernel yum* rpm* ssh* grub*" to 
upgrade the bare minimum to have a functioning system that you can SSH 
onto.  The point is to reduce the window in which the system can get 
into a corrupted, confused state.

4)    "/sbin/grub2-install /dev/[whichever drive contains your MBR]" to 
make sure you can boot to the new version.  I don't know if this step is 
strictly necessary, but it's more likely to help than hurt. (To figure 
out which drive contains your MBR, run "df | grep /boot"; if it comes 
back with "/dev/sda1 ", the drive is "sda".)

5)    "yum --releasever=[version] groupupdate 'Minimal Install'", just 
in case anything important got missed in step 3.

6)    Reboot.  Say prayers until it comes back up.

7)    "yum --releasever=[version] distro-sync" to update the rest of 
everything.  This could take a while, but even if it goes all peculiar 
because of an unexpected interruption, you probably still have a working 
system, running a mishmash of version 19 and version 20 packages.*



*: So, how do you fix it if yum gets interrupted and gets all confused 
about what packages you have and what packages you need? There are a few 
strategies to try:

- " yum-complete-transaction "

-    " package-cleanup --cleandupes "

-    "rm -f /var/lib/rpm/__db.*; rpmdb --rebuilddb; yum clean all; yum 
check-update "

But if you still have a ton of duplicate packages and output lines like 
"bbbbb is a duplicate with aaaaa", you're going to have to remove the 
duplicates by hand.  Fortunately, "by hand" can mean so many things.  
Run this command:

"yum check duplicates | awk '/is a duplicate/ {print $6}' > /tmp/DUPES"

This will put into /tmp/DUPES a list of all the "aaaaa" package names.  
(If you want to get a list of all the "bbbbb" names, use "$1" instead of 
"$6".)  Then run:

"yum remove `cat /tmp/DUPES`"

Or if that's too many files and you want to remove a subset -- say, 
everything from "a" thru "c" -- run this instead:

"yum remove `grep ^[a-c] /tmp/DUPES`"



More information about the OLUG mailing list