Current operating system: CentOS 4.x 64-bit
Upgrade CentOS 4.x to CentOS 5.x latest version online via Yum command
One, upgrade CentOS 4.x to CentOS 4.9 version
Cd/etc/yum.repos.d/# into the directory
MV Centos-base.repo Centos-base.repo-bak #Backup files
Yum source files for wget Http://vault.centos.org/4.9/CentOS-Base.repo #Download CentOS 4.9
Yum Clean all #Clean up the packages in the previous cache directory
Rm-f/var/lib/rpm/__db* #remove rpm package data
RPM--REBUILDDB #Rebuild rpm package data
Yum-y Update #Upgrade System
Second, upgrade CentOS 4.9 to CentOS 5.x latest edition (currently CentOS 5.10)
Rpm-qa | The grep kernel #查看系统当前内核 as follows:
#############################################
Kernel-devel-2.6.9-100.el
Kernel-smp-devel-2.6.9-100.el
Kernel-smp-devel-2.6.9-89.el
Kernel-largesmp-devel-2.6.9-100.el
Kernel-largesmp-devel-2.6.9-89.el
Rpm-e--nodeps--justdb Python-elementtree
#############################################
#Run the following command to remove the system kernel
Rpm-e--nodeps--justdb Kernel-smp-2.6.9-89.el
Rpm-e--nodeps--justdb Kernel-devel-2.6.9-100.el
Rpm-e--nodeps--justdb Kernel-smp-devel-2.6.9-100.el
Rpm-e--nodeps--justdb Kernel-2.6.9-100.el
Rpm-e--nodeps--justdb Kernel-smp-2.6.9-100.el
Rpm-e--nodeps--justdb Kernel-2.6.9-89.el
Rpm-e--nodeps--justdb Kernel-devel-2.6.9-89.el
Rpm-e--nodeps--justdb Kernel-smp-devel-2.6.9-89.el
Rpm-e--nodeps--justdb Kernel-largesmp-devel-2.6.9-100.el
Rpm-e--nodeps--justdb Kernel-utils-2.4-23.el4
Rpm-e--nodeps--justdb Kernel-largesmp-devel-2.6.9-89.el
Rpm-e--nodeps--justdb rpm-e--nodeps--justdb
Note: The kernel must be completely deleted, otherwise it will cause the upgrade to fail, after the deletion is complete, you can use the rpm-qa | grep kernel command to view again
System Yun-wei www.osyunwei.com warm reminder: qihang01 original Content © Copyright, reproduced please indicate the source and the original chain
Cd/etc/yum.repos.d/#Enter the directory
#Download CentOS 5.10 of two installation packages
Wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/centos-release-5-10.el5.centos.x86_64.rpm
Wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/centos-release-notes-5.10-0.x86_64.rpm
#Installation package
RPM-UVH centos-release-notes-5.10-0.x86_64.rpm
RPM-UVH centos-release-5-10.el5.centos.x86_64.rpm
#DownloadCentOS 5 of two installation packages, which will be used later
Wget http://vault.centos.org/5.0/os/x86_64/CentOS/python-sqlite-1.1.7-1.2.1.x86_64.rpm
Wget http://vault.centos.org/5.9/os/SRPMS/python-sqlite-1.1.7-1.2.1.src.rpm
Cd/etc/yum.repos.d/# into the directory
MV Centos-base.repo centos-base.repo-4 #Backup files
Download CentOS 5 Centos-base.repo and upload it to/etc/yum.repos.d/.
Download Address: http://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=1
Yum Clean all #Clean up the packages in the previous cache directory
Rm-f/var/lib/rpm/__db* #remove rpm package data
RPM--REBUILDDB #Rebuild rpm package data
Yum-y Remove *. {i386,i586,i686} #Delete the old package, important, otherwise system upgrade failed
Yum-y Upgrade #Upgrade System
You may encounter an error similar to the following:
Error 1:
Error:missing Dependency:python-abi = 2.3 is needed by package Python-elementtree
Solution:
#Download the following package
Wget http://vault.centos.org/4.4/os/x86_64/CentOS/RPMS/python-elementtree-1.2.6-4.2.1.x86_64.rpm
Rpm-e--nodeps Python-elementtree #Delete the current package of the system
RPM-UVH--nodeps python-elementtree-1.2.6-4.2.1.x86_64.rpm #Install the package you just downloaded
Error 2:
Error:missing dependency:libttf.so.2 () (64bit) is needed by package Bg5ps
Solution:
Yum-y Remove Bg5ps #drop
Yum-y Upgrade #Continue to upgrade the system
Until the upgrade is complete, appear complete!
Iii. Repair of Yum orders
After the system upgrade is complete, it will cause the Yum command to be unusable and repaired below
Cd/etc/yum.repos.d/# into the directory
#Install the package before downloading
RPM-UVH--nodeps python-sqlite-1.1.7-1.2.1.x86_64.rpm
RPM-IVH python-sqlite-1.1.7-1.2.1.src.rpm
Cd/usr/src/redhat/specs #Enter the directory
RPMBUILD-BB *.spec #Create rpm包
Cd/usr/src/redhat/rpms/x86_64 #Enter the directory
#Install all packages in this directory
RPM-UVH--force python-sqlite-debuginfo-1.1.7-1.2.1.x86_64.rpm
RPM-UVH--force python-sqlite-1.1.7-1.2.1.x86_64.rpm
Setting system startup Parameters
Lsb_release-a #View system version information, as shown in the following figure
Rpm-qa | grep kernel #View system kernel, if not, run yum install kernel kernel-pae install kernel
Cat/boot/grub/grub.conf #View system startup settings, as shown in the following figure
System Yun-wei www.osyunwei.com warm reminder: qihang01 original Content © Copyright, reproduced please indicate the source and the original chain
##########################################
Splashimage= (hd0,0)/grub/splash.xpm.gz
Title CentOS (2.6.18-371.9.1.EL5)
Kernel/vmlinuz-2.6.18-371.9.1.el5 ro ROOT=LABEL=/1
Initrd/initrd-2.6.18-371.9.1.el5.img
##########################################
You can see that the new system kernel (2.6.18-371.9.1.EL5) has been automatically added as the default startup
Shutdown-r now #restart the system
Uname-a #View current system kernel
At this point, online upgrade CentOS 4.x to CentOS 5.x latest version of the tutorial completed.