Editing Centos Upgrade 4.x to 5.x
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 6: | Line 6: | ||
follow these steps: | follow these steps: | ||
− | == | + | ==Create a container using centos-4-i386-minimal and set a valid nameserver== |
− | |||
− | Create a container using centos-4-i386-minimal and set a valid nameserver | ||
<pre> | <pre> | ||
vzctl create $CTID --ostemplate centos-4-i386-minimal --config CONFIG_TEMPLATE --ipadd container_IP --hostname temp | vzctl create $CTID --ostemplate centos-4-i386-minimal --config CONFIG_TEMPLATE --ipadd container_IP --hostname temp | ||
Line 14: | Line 12: | ||
</pre> | </pre> | ||
+ | == Enter container == | ||
+ | <pre> | ||
+ | vzctl enter $CTID | ||
+ | </pre> | ||
==Install centos-5-release packages== | ==Install centos-5-release packages== | ||
− | |||
− | + | rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-notes-5.6-0.i386.rpm \ | |
− | + | http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-5-6.el5.centos.i386.rpm | |
− | + | ||
Note: centos-release-5 depends on notes-package, start with that one. | Note: centos-release-5 depends on notes-package, start with that one. | ||
==Backup dev== | ==Backup dev== | ||
− | Backup | + | Backup your /dev/ directory, as initscripts needs udev and will remove vzdev you'll need the backup: |
<pre> | <pre> | ||
− | tar -cf | + | tar -cf dev.tar ./dev |
</pre> | </pre> | ||
− | == | + | ==Install initscripts package (forced and with no deps)== |
− | |||
− | Install initscripts package (forced and with no deps) | ||
<pre> | <pre> | ||
− | + | rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/initscripts-8.45.33-1.el5.centos.i386.rpm --force --nodeps | |
</pre> | </pre> | ||
Note: If the "transfer failed", go to the [http://mirror.centos.org/centos/5/os/i386/CentOS/ CentOS5 mirror] and find the latest initscripts rpm and use that instead. | Note: If the "transfer failed", go to the [http://mirror.centos.org/centos/5/os/i386/CentOS/ CentOS5 mirror] and find the latest initscripts rpm and use that instead. | ||
+ | |||
+ | ==Exit from container== | ||
+ | <pre> | ||
+ | exit | ||
+ | </pre> | ||
==Update conf file== | ==Update conf file== | ||
Line 54: | Line 58: | ||
Alternatively, use the 'sed' command to replace it: | Alternatively, use the 'sed' command to replace it: | ||
<pre> | <pre> | ||
− | sed -i 's#OSTEMPLATE="centos-4#OSTEMPLATE="centos-5#g' /etc/vz/conf/$ | + | sed -i 's#OSTEMPLATE="centos-4#OSTEMPLATE="centos-5#g' /etc/vz/conf/$CSID.conf |
</pre> | </pre> | ||
Line 110: | Line 114: | ||
<pre> | <pre> | ||
− | vzctl exec | + | vzctl exec 113 rpm -e --justdb python-elementtree --nodeps |
− | vzctl exec | + | vzctl exec 113 rpm --import http://mirrors.kernel.org/centos/RPM-GPG-KEY-CentOS-5 |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Stop your VE== | ==Stop your VE== | ||
Line 137: | Line 123: | ||
</pre> | </pre> | ||
− | == | + | ==Replace the new /dev/ with the old one== |
− | |||
− | |||
<pre> | <pre> | ||
− | + | cd /vz/private/$CTID | |
− | tar -xvf | + | rm -rf dev |
+ | tar -xvf dev.tar | ||
</pre> | </pre> | ||