Upgrade to CentOS 7

Author: | Posted in distro, howto 73 Comments

Last month Red Hat released RHEL 7 and few days ago CentOS announced the GA of CentOS 7. As you may know, starting RHEL 7 Red Hat introduces support for upgrading to major releases (RHEL 6.5 –> RHEL 7) via a tool called redhat-upgrade-tool. Not sure if this is 100% supported by CentOS at this time, but I found the CentOS rpm packages on their development site and thought of giving them a try and luckily it turned out OK.

Of course this is only a proof of concept, it may possibly not work by default on production environments, so use with care. For my test I used a fully updated base installation of CentOS 6.5 VM running on VirtualBox.

 

Download required packages

 

mkdir -p /root/upgrade
cd /root/upgrade
wget http://dev.centos.org/centos/6/upg/x86_64/Packages/preupgrade-assistant-1.0.2-33.0.3.el6.centos.x86_64.rpm http://dev.centos.org/centos/6/upg/x86_64/Packages/preupgrade-assistant-contents-0.5.13-1.0.5.el6.centos.noarch.rpm http://dev.centos.org/centos/6/upg/x86_64/Packages/preupgrade-assistant-ui-1.0.2-33.0.3.el6.centos.x86_64.rpm http://dev.centos.org/centos/6/upg/x86_64/Packages/redhat-upgrade-tool-0.7.22-3.el6.centos.noarch.rpm

 

Install preupgrade assistant

 

yum localinstall preupgrade-assistant-*

 

Run preupgrade assistant

 

preupg

 This does a check on the installed system and tries to identify potential issues after the upgrade. It should be run until all tests pass successfully. Not sure it did anything on my VM as all tests returned “not applicable”. I haven’t used the original tool (for RHEL7) but I suspect the CentOS equivalent is still work in progress, so I decided to skip it. More info on the preupgrade assistant is available in the RedHat official documentation.

 

Install redhat-upgrade-tool

 

yum localinstall redhat-upgrade-tool-0.7.22-3.el6.centos.noarch.rpm

 

Import the CentOS 7 rpm gpg key

 

rpm --import http://ftp.plusline.de/centos/7.0.1406/os/x86_64/RPM-GPG-KEY-CentOS-7

 

Run the upgrade tool

 

The tool can use a local ISO, the local media drive or a network URL to perform the upgrade. The network command argument needs to be followed by a release version (rawhide is also supported) and a valid installation repository (at the time of this writing not all repositories were updated or reachable, so I did some trial and error until I found a working repo) which can be defined as a standard URL or a mirror (full mirror list is available here).

redhat-upgrade-tool --network 7.0 --instrepo http://ftp.plusline.de/centos/7.0.1406/os/x86_64/

Should this warn you that you didn’t run the upgrade assistant, you can force its execution by adding the extra option:

redhat-upgrade-tool --network 7.0 --instrepo http://ftp.plusline.de/centos/7.0.1406/os/x86_64/ --force

A successful run ends with this message: “Finished. Reboot to start upgrade.

 

Reboot

 

After restarting the machine, the OS will boot a new grub entry called System Upgrade which is supposed to upgrade all packages previously downloaded by the upgrade tool. I ran into a small problem here “Database environment version mismatch” likely caused by the rpm tool itself (rpm version is 4.11 in CentOS 7 and 4.8 in CentOS 6).

cd /mnt/var/lib/rpm
rm __*
init 6

Removing the rpm database files and rebooting worked for me (CTRL+D or exiting the shell should also work as that would exit the emergency mode and continue from the last step before the error occurred) and the upgrade went through without other issues.

cat /etc/centos-release
CentOS Linux release 7.0.1406 (Core)

 

UPDATE

 

If you follow this guide make sure you use the latest releases of the upgrade packages (preupgrade-assistant-* and redhat-upgrade-tool) as provided by CentOS here. Also note that after the writing of this article, CentOS published a wiki page on the upgrade tool so it’s probably best to use that instead. Thanks.

 

Comments
  1. Posted by duydangle
    • Posted by admin
  2. Posted by tony
    • Posted by admin
  3. Posted by cvoltz
    • Posted by admin
  4. Posted by cvoltz
    • Posted by admin
  5. Posted by cvoltz
  6. Posted by Goran
  7. Posted by Niko_K
  8. Posted by daiwalkr
  9. Posted by admin
  10. Posted by Goran
    • Posted by admin
  11. Posted by Nikolaus Krismer
    • Posted by admin
  12. Posted by Jelly
  13. Posted by Niko_K
  14. Posted by NetNut404
  15. Posted by Goran
  16. Posted by nidhin
    • Posted by admin
  17. Posted by aquishix
    • Posted by admin
  18. Posted by Gaston
  19. Posted by jodan20xx
  20. Posted by Giorgos
  21. Posted by Iceman
  22. Posted by Iceman
  23. Posted by Giorgos
  24. Posted by Iceman
  25. Posted by Iceman
  26. Posted by Giorgos
  27. Posted by Iceman
  28. Posted by Iceman
  29. Posted by Giorgos
  30. Posted by Iceman
  31. Posted by Giorgos
  32. Posted by Iceman
  33. Posted by Iceman
  34. Posted by Giorgos
  35. Posted by Giorgos
  36. Posted by Iceman
  37. Posted by Mohammad Farouk
    • Posted by admin
  38. Posted by Mohamed Abdou
    • Posted by admin
  39. Posted by Hans Persson
  40. Posted by Christopher Voltz
  41. Posted by Mehdi
  42. Posted by Ali Mansoor
    • Posted by admin
  43. Posted by Ravi
    • Posted by admin
  44. Posted by Ravi
    • Posted by admin
  45. Posted by mischa
    • Posted by admin
  46. Posted by mischa
  47. Posted by Gaston
  48. Posted by Carsten Varming
  49. Posted by Steven
  50. Posted by Steven
  51. Posted by Mark
  52. Posted by Paul
    • Posted by admin
  53. Posted by Thomas
  54. Posted by Thomas
  55. Posted by Thomas
  56. Posted by serg
  57. Posted by Hituraj
  58. Posted by Rolf

Add Your Comment