Personal tools
You are here: Home Team Members Dennis Johnson Distribution upgrades and cleaning up after them.

Distribution upgrades and cleaning up after them.

by D. Johnson last modified Dec 03, 2012 12:45 AM
— filed under:

This page shows how to clean up after a distribution upgrade.

Applicable to Fedora Versions

  • All Fedora versions

Requirements

Explanation of requirements.
  1. Make a proper backup of your system before making any major changes.
  2. Before you begin, please insure that you have current software: su -c "yum update"
  3. Please read the common bugs link: https://fedoraproject.org/wiki/Common_F16_bugs -or- https://fedoraproject.org/wiki/Common_F15_bugs as appropriate.
  4. Please read https://fedoraproject.org/wiki/How_to_use_PreUpgrade if you use Preupgrade
  5. Please read http://fedoraproject.org/wiki/YumUpgradeFaq if you are planning on using this method.

Doing the Work

Basic description of what will be done and what is expected.

  1. Change runlevel to 3 / multiuser (Not graphical. See: http://fedoraunity.org/solved/post-install-solutions/runlevel/ and https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet ) (Use the grub method) and login as root.  You can use "cnetworkmanager" or "nmcli" if you need to get networking started without the GUI.  Do not launch the GUI. This step is critically important.  Do not deviate.
  2. Update your system: (Some warnings at this stage are normal. They should be resolved normally a bit later on.)
    # rm /var/lib/rpm/__db.00?;
    # yum clean all;
    # yum-complete-transaction;
    # yum update --skip-broken;
    # rpm -a --setugids; rpm -a --setperms;
    If your installed version is higher than Fedora14 or RHEL6, this will reset capabilities:
    # rpm -Va > /tmp/rpm-Va0.txt 2>&1;
    # awk '/^.{8}P /{print$NF}' /tmp/rpm-Va0.txt \
      |xargs rpm --filecaps -qf \
      |grep '= cap' \
      |while read fileName eq fileCaps; do
        setcap "${fileCaps}" "${fileName}"
      done
    # yum install @core @base;
  3. (Optional) Remove old packages from cache directories
    # DIST=$(rpm --eval '%{dist}'); find /var/cache/yum/ -type f -name \*.rpm |grep -v $DIST |xargs rm -f;
    If you have yum-plugin-local installed, you will want to free up spaced it used:
    # DIST=$(rpm --eval '%{dist}'); find /var/lib/yum/plugins/local/ -type f -name \*.rpm |grep -v $DIST |xargs rm -f;
  4. (Optional) Install basic components you would have from a new install:  You likely want to include the desktop of your choice as well, such as @gnome-desktop or @kde-desktop or @xfce-desktop or @lxde-desktop 
    # yum install @base-x @base @core @fonts @input-methods @admin-tools @dial-up @hardware-support @printing fpaste memtest86+ @gnome-desktop;
  5. Correct labels and reboot:  (This command takes about 11 minutes to run on my hardware.  Yours may be quicker or slower.  Give it time to complete.)
    # fixfiles -R -a restore; restorecon -Rv /home/*/.local/; reboot;
    The above command only does the files yum/rpm installed. If you would rather relabel all files on the system, use this instead: (Note: It may take longer on reboot)
    # fixfiles onboot; reboot;
  6. Newer versions of yum include this command.  If your version does not yet support it, skip this step:  (yum-3.2.28-1 is known to work)
    # yum distribution-synchronization --disablepresto;
  7. Login again with runlevel 3 and as root.  Install yum-utils and print out a list of all the packages that need review:  (This will print out packages that have dependency problems as well as packages that are no longer found in your configured repos and any duplicate packages you might have.)
    # rpm -Va --nofiles --nodigest;
    # yum install yum-utils;
    # package-cleanup --problems;
    # package-cleanup --orphans;
    # package-cleanup --dupes;
    (optionally locate packages you may not need any longer)
    # package-cleanup --leaves;
  8. In most cases, you should remove the versions listed above and install the current distribution version of the package instead if you still use it.
  9. Create a list of all the files that have verify concerns:
    # . /etc/sysconfig/prelink && /usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink/prelink.log 2>&1;
    # /sbin/ldconfig;
    # rpm -Va > /tmp/rpm-Va.txt 2>&1;
  10. Using the above, create a list of non-configuration files that need review:
  11. # egrep -v '^.{9}  c /' /tmp/rpm-Va.txt > /tmp/URGENT-REVIEW.txt;
  12. Using the above, create a list of configuration files that need review:
  13. # egrep '^.{9}  c /' /tmp/rpm-Va.txt > /tmp/REVIEW-CONFIGS.txt;
  14. Review the lists above. Consult "man rpm" under the VERIFY section for the meaning of the first column.  You can usually ignore lines if they have a "prelink: /usr/bin/somefile: at least one of file's dependencies has changed since prelinking" type message next to it.
  15. Locate your changed config files and manually merge the changes (If you have yum-plugin-merge-conf installed, you can use it here to assist as well):
  16. # yum install rpmconf; rpmconf -a; 
  17. # find /etc /var -name '*.rpm?*' > /tmp/REVIEW-OBSOLETE-CONFIGS.txt;

Troubleshooting

How to test

Explanation troubleshooting basics and expectations.
  1. Recreate an initrd image for F12+:
  2. # dracut -f /boot/initramfs-$(uname -r).img $(uname -r);

  3. Restore the MBR:
  4. # grub-install;
  5. Xorg refuses to start.  This happens typically if you had an old version, or if you had nvidia.ko / fglrx.ko / catalyst.ko drivers.  Move the xorg.conf out of the way and regenerate a new one.
  6. # mv /etc/X11/xorg.conf /root/xorg.conf.save

Common problems and fixes

More Information

Always have a clean backup before you begin any major work on your distribution.

  1. The absolute best method to upgrade is to backup, and format clean with a fresh install.
  2. Second best, DVD media - can be on a real DVD or on USB.
  3. Third best, Preupgrade.
  4. Last resort option, for experienced users only, yum upgrade.
  5. You cannot use the Livecd media to perform upgrades.

 

Disclaimer

We test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #fedora on irc.freenode.net

Added Reading

Document Actions
Log in


Forgot your password?
New user?