I am trying to build a new CentOS 6 VM from my CentOS 5 host, but it appears that something fundamental has changed between these versions:
$ rpm -ivh --nodeps --nodigest --ignorearch --ignoreos --force --root=/mnt centos-release-6-0.el6.centos.5.i686.rpm
warning: centos-release-6-0.el6.centos.5.i686.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID c105b9de
Preparing... ########################################### [100%]
1:centos-release ########################################### [100%]
error: unpacking of archive failed: cpio: Bad magic
$ rpm --version
RPM version 4.4.2.3
Did the magic number of RPMs change between these versions? How do I work around this?
EDIT (Clarification):
I am not trying to upgrade an existing machine. I am trying to create a new installation using yum --installroot=/mnt groupinstall core. In order to get a working config, step one is to install the release rpm which contains the yum repo config.
Cant do that, AFAIK: the bad magic in the RPM is the least of the problems.
In short: there is no reccommended RHEL5->RHEL6 upgrade path, hence no Centos5->6. I tried a little skulduggery in that direction (I have a largish number of C5 servers myself) but decided against it.
Consider that a 5->6 transition amounts to a fedora core 6->12 transition BUT without preupgrade support in yum. So you could conceivably pop a FC7 DVD, boot with
selinux=0 upgradeany
rinse, and repeat with FC8...FC11 ending with CentOS6. And good luck with that - speaking of my own machines I'd be rather surprised by ending up with anything more sophisticated than bash in working order - this after a couple of days spent in attempting this funky feat.
I estimate I'd probably rebuild a (working) machine in less time. Which is just as well, given that RHEL5 still has a couple of years of support.
Problems
The issues are as follows:
Solution
WARNING: Below solution to issue 1 is DANGEROUS. If RPM upgrade breaks you are likely to end up with a broken system. Solution to issue 2 may result in installation of broken packages!
Issue 1 can be circumvented by backporting RPM 4.6 from source RPM. See http://orcorc.blogspot.com/2009/03/oh-my-goodness.html.
Build dependencies for soure RPM:
No proper lua in my CentOS dist. Acquired from rpmsearch:
Install and build the source RPM. May of course require additional packages, such as gcc:
Test before actually installing replacement RPMs:
We can now install baseline:
Issue 2 can be worked around by manually editing /usr/lib/python2.4/site-packages/yum files (PYTHONPATH magic could be used to make this somewhat less hackish). The diff looks thus:
We are now ready to perform yum groupinstall:
Note that since we have disabled most package verification, packages may fail installation at this step. Pay close attention to output:
Rinse and repeat.
Since core won't do any system setup, you may need to do any number of things before next step. I need to provide /mnt/etc/resolv.conf.
We now have an environment that can be chrooted into for issue 3:
Fortunately, this is easy to fix: just rebuild /var/lib/rpm:
At this point I ran into the classic $releasever issue, so I had to edit /etc/yum.repos.d/* to replace $releasever with 6. Something like:
There is probably a better way to do this, but I haven't found it.
After this edit, yum works as expected and I have a working CentOS 6 built from CentOS 5. Any chroot environment/VM guest setup instruction for CentOS 6 should be able to get you to a full-blown system.
Great,
in that case for me system crash, was needed to do something more creazy with respect to system.
Many things are so depended on actual state of system so diferences are excepted Moust importatn thing was to resolve "RPM: the bad magic"
before start check Other WAY !!! as
Sometihing is wrong? then you can use rpm2cpio or mc to extract cpio then cpio for extract rpm files and copy manualy to folders don't forget to run ldconfig after that
Probably you have to get new version of cpio for extracting cpio contents
So im going to el6 versions to fix that.
Means, have to made RPM going to work again then i can reinstall other packages.
Because system is broken and no more libraries for el6 are avaiable to install have to compile everything depended from sources.
1) install so much as possible depencies from el5 repository by yum with devel packages where are header files like nss3 + devel lzma + devel nspr4 + devel ncurses + devel readline db-4.5.20 + devel rpm-libs + devel
in other case have to download sources and compile
2) keep going cpio,lzma for get content of SRPMs and patches download cpio 2.10+ better = from home page compile and install download rpm 4.6.0+ better = from home page compile and install download rpm-libs 4.6.0+ better = from home page compile and install download db-4.5.20 better = from home page compile and install
rpm* el6 has 4.8.* but for compatibility is ok 4.6+
If works rpmbuild --rebuild will be greate full in midle lines means it that GOD bless you and you have already installed proper versions of headers and libs
Or for other depencies download src.rpm files Unpack rpm,cpio, main archive apply patches to one folder
http://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/
always apply patches like, have to specify right file names or make symlinks in same folder
after all build of libs like lzma and other you have to do
for configuring RPM
other configures like cpio
in case of rollback you have to reinstall rpm manualy or replace files with backuped versions and run ldconfig
command
All is correct?
% make install
and continue with "We can now install baseline:" or if you prefer just update remove other repositories from /etc/yum.repos.d keep just el6 packages
BE CAREFULL and say no if you are not sure there will be some removes, other depencies you have to install manualy with rpm
to create local repository from install DVD just mount isos to mnt and call in mnt
SOME repositories FIX $releasever with version of el5
Kindly yould like to invite you to my pages, than who like it, do likes.
Facebook page