From Fedora Project Wiki
(Created page with "Applicable to Fedora Versions All Fedora versions Requirements Explanation of requirements. Make a proper backup of your system before making any major changes. ...")
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Applicable to Fedora Versions
= Applicable to Fedora Versions =


     All Fedora versions
     All Fedora versions


Requirements
= Requirements =
Explanation of requirements.
Explanation of requirements.


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


Doing the Work
= Doing the Work =


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


    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.
#    Change runlevel to 3 / multiuser (Not graphical. See: https://fedoraproject.org/wiki/Systemd#How_do_I_change_the_runlevel.3F 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.
    Update your system: (Some warnings at this stage are normal. They should be resolved normally a bit later on.)
#    Update your system: (Some warnings at this stage are normal. They should be resolved normally a bit later on.)
 
<pre>
     # rm /var/lib/rpm/__db.00?;
     # rm /var/lib/rpm/__db.00?;
     # yum clean all;
     # yum clean all;
     # yum-complete-transaction;
     # yum-complete-transaction;
     # yum update --skip-broken;
     # yum update --skip-broken;
     # rpm -a --setugids; rpm -a --setperms;
     # rpm -a --setugids; rpm -a --setperms;
 
</pre>
    If your installed version is higher than Fedora14 or RHEL6, this will reset capabilities:
#    If your installed version is higher than Fedora14 or RHEL6, this will reset capabilities:
 
<pre>
     # rpm -Va > /tmp/rpm-Va0.txt 2>&1;
     # rpm -Va > /tmp/rpm-Va0.txt 2>&1;
     # awk '/^.{8}P /{print$NF}' /tmp/rpm-Va0.txt \
     # awk '/^.{8}P /{print$NF}' /tmp/rpm-Va0.txt \
Line 40: Line 37:


     # yum install @core @base;
     # yum install @core @base;
 
</pre>
    (Optional) Remove old packages from cache directories
#    (Optional) Remove old packages from cache directories
 
<pre>
     # DIST=$(rpm --eval '%{dist}'); find /var/cache/yum/ -type f -name \*.rpm |grep -v $DIST |xargs rm -f;
     # DIST=$(rpm --eval '%{dist}'); find /var/cache/yum/ -type f -name \*.rpm |grep -v $DIST |xargs rm -f;
 
</pre>
    If you have yum-plugin-local installed, you will want to free up spaced it used:
#    If you have yum-plugin-local installed, you will want to free up spaced it used:
 
<pre>
     # DIST=$(rpm --eval '%{dist}'); find /var/lib/yum/plugins/local/ -type f -name \*.rpm |grep -v $DIST |xargs rm -f;
     # DIST=$(rpm --eval '%{dist}'); find /var/lib/yum/plugins/local/ -type f -name \*.rpm |grep -v $DIST |xargs rm -f;
 
</pre>
    (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  
#    (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  
 
<pre>
     # yum install @base-x @base @core @fonts @input-methods @admin-tools @dial-up @hardware-support @printing fpaste memtest86+ @gnome-desktop;
     # yum install @base-x @base @core @fonts @input-methods @admin-tools @dial-up @hardware-support @printing fpaste memtest86+ @gnome-desktop;
 
</pre>
    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.)
#    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.)
 
<pre>
     # fixfiles -R -a restore; restorecon -Rv /home/*/.local/; reboot;
     # fixfiles -R -a restore; restorecon -Rv /home/*/.local/; reboot;
</pre>
#    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)


    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)
<pre>
 
     # fixfiles onboot; reboot;
     # fixfiles onboot; reboot;
</pre>


    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)
#    Depending on your version of yum, at least one of these will work. It is sorted from oldest to newest, but they all accomplish the same task. (Disable deltarpm/presto, and synchronizes the installed package set with the latest packages available, this is done by either obsoleting, upgrading or downgrading as appropriate.)


     # yum distribution-synchronization --disablepresto;
<pre>
    # yum distribution-synchronization --disableplugin=presto --skip-broken;
     # yum distribution-synchronization --disablepresto --skip-broken;
    # yum distribution-synchronization --setopt=deltarpm=0 --skip-broken;
</pre>


    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.)
#    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.)


<pre>
     # rpm -Va --nofiles --nodigest;
     # rpm -Va --nofiles --nodigest;
     # yum install yum-utils;
     # yum install yum-utils;
     # package-cleanup --problems;
     # package-cleanup --problems;
     # package-cleanup --orphans;
     # package-cleanup --orphans;
    # package-cleanup --dupes;
</pre>


    # package-cleanup --dupes;
#   (optionally locate packages you may not need any longer)


    (optionally locate packages you may not need any longer)
<pre>
     # package-cleanup --leaves;
     # package-cleanup --leaves;
</pre>


    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.
#    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.
    Create a list of all the files that have verify concerns:
#    Create a list of all the files that have verify concerns:


<pre>
     # . /etc/sysconfig/prelink && /usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink/prelink.log 2>&1;
     # . /etc/sysconfig/prelink && /usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink/prelink.log 2>&1;
     # /sbin/ldconfig;
     # /sbin/ldconfig;
     # rpm -Va > /tmp/rpm-Va.txt 2>&1;
     # rpm -Va > /tmp/rpm-Va.txt 2>&1;
</pre>


    Using the above, create a list of non-configuration files that need review:
#    Using the above, create a list of non-configuration files that need review:


<pre>
     # egrep -v '^.{9}  c /' /tmp/rpm-Va.txt > /tmp/URGENT-REVIEW.txt;
     # egrep -v '^.{9}  c /' /tmp/rpm-Va.txt > /tmp/URGENT-REVIEW.txt;
</pre>


    Using the above, create a list of configuration files that need review:
#    Using the above, create a list of configuration files that need review:


<pre>
     # egrep '^.{9}  c /' /tmp/rpm-Va.txt > /tmp/REVIEW-CONFIGS.txt;
     # egrep '^.{9}  c /' /tmp/rpm-Va.txt > /tmp/REVIEW-CONFIGS.txt;
</pre>


    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.
#    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.
    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):
#    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):


<pre>
     # yum install rpmconf; rpmconf -a;  
     # yum install rpmconf; rpmconf -a;  
     # find /etc /var -name '*.rpm?*' > /tmp/REVIEW-OBSOLETE-CONFIGS.txt;
     # find /etc /var -name '*.rpm?*' > /tmp/REVIEW-OBSOLETE-CONFIGS.txt;
</pre>


Troubleshooting
= Troubleshooting =
How to test
How to test
Explanation troubleshooting basics and expectations.
Explanation troubleshooting basics and expectations.


    Recreate an initrd image for F12+:
#    Recreate an initrd image for F12+: <pre># dracut -f /boot/initramfs-$(uname -r).img $(uname -r);</pre>
#    Restore the MBR:<pre># grub-install;</pre><pre># grub2-mkconfig -o /boot/grub2/grub.cfg;</pre>
#    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.<pre># mv /etc/X11/xorg.conf /root/xorg.conf.save</pre>


    # dracut -f /boot/initramfs-$(uname -r).img $(uname -r);
= Common problems and fixes =


    Restore the MBR:
Go back and read the release notes, common bugs link and upgrade path notes:


    # grub-install;
* http://docs.fedoraproject.org/release-notes/
* http://docs.fedoraproject.org/install-guide/
* https://fedoraproject.org/wiki/Common_bugs


    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.
Have an issue not covered here? See https://bugzilla.redhat.com/


    # mv /etc/X11/xorg.conf /root/xorg.conf.save
= More Information =


Common problems and fixes
Always have a clean backup before you begin any major work on your distribution.


    Go back and read the release notes, common bugs link and upgrade path notes:
*    The absolute best method to upgrade is to backup, and format clean with a fresh install.
*    Second best, DVD media - can be on a real DVD or on USB. (For versions of anaconda that can still do an upgrade)
*    Third best, Preupgrade / FedUp.
*    Last resort option, for experienced users only, yum upgrade.
*    You cannot use the Livecd media to perform upgrades.


    http://docs.fedoraproject.org/release-notes/
= Disclaimer =


    http://docs.fedoraproject.org/install-guide/
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
    https://fedoraproject.org/wiki/Common_bugs
 
    Have an issue not covered here?  See https://bugzilla.redhat.com/
 
More Information
 
Always have a clean backup before you begin any major work on your distribution.


    The absolute best method to upgrade is to backup, and format clean with a fresh install.
*    https://fedoraproject.org/wiki/Common_F20_bugs
    Second best, DVD media - can be on a real DVD or on USB.
*    https://fedoraproject.org/wiki/Common_F19_bugs
    Third best, Preupgrade.
*    https://fedoraproject.org/wiki/Common_F18_bugs
    Last resort option, for experienced users only, yum upgrade.
*    https://fedoraproject.org/wiki/Common_F17_bugs
    You cannot use the Livecd media to perform upgrades.
*    https://fedoraproject.org/wiki/Common_F16_bugs
*    https://fedoraproject.org/wiki/Common_F15_bugs
*    https://fedoraproject.org/wiki/Common_F14_bugs
*    https://fedoraproject.org/wiki/Common_F13_bugs
*    http://docs.fedoraproject.org/
*    https://fedoraproject.org/wiki/How_to_use_PreUpgrade and
*    https://fedoraproject.org/wiki/Common_F12_bugs#Issues_when_upgrading_from_previous_releases and
*    https://fedorahosted.org/fesco/ticket/270
*    http://fedoraproject.org/wiki/YumUpgradeFaq
*    http://www.rpm.org/wiki/Docs/RpmRecovery


= Sample Scripts =
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
*    Report what needs review: http://fedorapeople.org/cgit/fenris02/public_git/cleanup.git/plain/rpm-verify.sh
Added Reading
*    When you really need a reboot: http://fedorapeople.org/cgit/fenris02/public_git/cleanup.git/plain/raising-elephants.sh
*    New disk that you want to inspect: http://fedorapeople.org/cgit/fenris02/public_git/cleanup.git/plain/drivetest.sh


    https://fedoraproject.org/wiki/Common_F14_bugs
= Questions / Comments? =
    https://fedoraproject.org/wiki/Common_F13_bugs
    http://docs.fedoraproject.org/
    https://fedoraproject.org/wiki/How_to_use_PreUpgrade and
    https://fedoraproject.org/wiki/Common_F12_bugs#Issues_when_upgrading_from_previous_releases and
    https://fedorahosted.org/fesco/ticket/270
    http://fedoraproject.org/wiki/YumUpgradeFaq
    http://www.rpm.org/wiki/Docs/RpmRecovery

Latest revision as of 03:07, 23 December 2013

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_F20_bugs -or- https://fedoraproject.org/wiki/Common_F19_bugs as appropriate.
  4. Please read https://fedoraproject.org/wiki/How_to_use_PreUpgrade if you use Preupgrade
  5. Please read https://fedoraproject.org/wiki/FedUp if you use FedUp
  6. 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: https://fedoraproject.org/wiki/Systemd#How_do_I_change_the_runlevel.3F 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;
  1. 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;
  1. (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;
  1. 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;
  1. (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;
  1. 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;
  1. 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;
  1. Depending on your version of yum, at least one of these will work. It is sorted from oldest to newest, but they all accomplish the same task. (Disable deltarpm/presto, and synchronizes the installed package set with the latest packages available, this is done by either obsoleting, upgrading or downgrading as appropriate.)
    # yum distribution-synchronization --disableplugin=presto --skip-broken;
    # yum distribution-synchronization --disablepresto --skip-broken;
    # yum distribution-synchronization --setopt=deltarpm=0 --skip-broken;
  1. 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;
  1. (optionally locate packages you may not need any longer)
    # package-cleanup --leaves;
  1. 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.
  2. 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;
  1. Using the above, create a list of non-configuration files that need review:
    # egrep -v '^.{9}  c /' /tmp/rpm-Va.txt > /tmp/URGENT-REVIEW.txt;
  1. Using the above, create a list of configuration files that need review:
    # egrep '^.{9}  c /' /tmp/rpm-Va.txt > /tmp/REVIEW-CONFIGS.txt;
  1. 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.
  2. 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):
    # yum install rpmconf; rpmconf -a; 
    # 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+:
    # dracut -f /boot/initramfs-$(uname -r).img $(uname -r);
  2. Restore the MBR:
    # grub-install;
    # grub2-mkconfig -o /boot/grub2/grub.cfg;
  3. 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.
    # mv /etc/X11/xorg.conf /root/xorg.conf.save

Common problems and fixes

Go back and read the release notes, common bugs link and upgrade path notes:

Have an issue not covered here? See https://bugzilla.redhat.com/

More Information

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

  • The absolute best method to upgrade is to backup, and format clean with a fresh install.
  • Second best, DVD media - can be on a real DVD or on USB. (For versions of anaconda that can still do an upgrade)
  • Third best, Preupgrade / FedUp.
  • Last resort option, for experienced users only, yum upgrade.
  • 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

Sample Scripts

Questions / Comments?