OpenVZ Forum


Home » General » Support » [Solved]Can't install yum on container.
[Solved]Can't install yum on container. [message #32287] Wed, 30 July 2008 11:46 Go to next message
JimL is currently offline  JimL
Messages: 116
Registered: February 2007
Senior Member
Running openvz on Ubuntu Hardy. Couldn't figure out how to make vzyum work on that platform so I went to a Centos 5 system to build a container and then migrate it.

First problem:

vzyum 733 install yum
ERROR: vzrpm43 path not found: /usr/share/vzpkgtools/vzrpm43
ERROR: RPM python path not found: /lib/python2.4/site-packages

OK so I noticed that rpm was 44 not 43, so I changed the /vz/template/centos/4/i386/config/rpm to 44 from 43. I have no idea who maintains that file since it isn't in any package according to rpm -qf.

Now I get :
vzyum 733 install yum
exec /usr/share/vzyum/bin/yum -c /vz/template/centos/4/i386/config/yum.conf --installroot /vz/root/733 --vps=733 install yum
rpmdb: unable to initialize mutex: Invalid argument
rpmdb: PANIC: Invalid argument
rpmdb: PANIC: DB_RUNRECOVERY: Fatal error, run database recovery
error: db4 error(-30977) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30977)
error: cannot open Packages database in /vz/root/733/var/lib/rpm
Traceback (most recent call last):
File "/usr/share/vzyum/bin/yum", line 28, in ?
yummain.main(sys.argv[1:])
File "/usr/share/vzyum/yum-cli/yummain.py", line 75, in main
base.getOptionsConfig(args)
File "/usr/share/vzyum/yum-cli/cli.py", line 172, in getOptionsConfig
self.doConfigSetup(fn=opts.conffile, root=root, vps=opts.vps)
File "/usr/share/vzyum/lib/yum/__init__.py", line 82, in doConfigSetup
self.conf = config.yumconf(configfile=fn, root=root, vps=vps)
File "/usr/share/vzyum/lib/yum/config.py", line 271, in __init__
self.yumvar['releasever'] = self._getsysver()
File "/usr/share/vzyum/lib/yum/config.py", line 384, in _getsysver
idx = ts.dbMatch('provides', self.getConfigOption('distroverpkg'))
TypeError: rpmdb open failed

I have no idea what to do about that but I do have another Centos 5 system running openvz so off to that system.

vzyum 733 install yum
...
Installed: yum.noarch 0:2.4.3-4.el4.centos
Dependency Installed: elfutils.i386 0:0.97.1-5 expat.i386 0:1.95.7-4 gmp.i386 0:4.1.4-3 libxml2.i386 0:2.6.16-10.1 libxml2-python.i386 0:2.6.16-10.1 python.i386 0:2.3.4-14.4.el4_6.1 python-elementtree.i386 0:1.2.6-5.el4.centos python-sqlite.i386 0:1.1.7-1.2.1 python-urlgrabber.noarch 0:2.9.8-2 readline.i386 0:4.3-13 rpm-python.i386 0:4.3.3-23_nonptl sqlite.i386 0:3.3.6-2 yum-metadata-parser.i386 0:1.0-8.el4.centos
Dependency Updated: elfutils-libelf.i386 0:0.97.1-5 rpm.i386 0:4.3.3-23_nonptl
Complete!

So that part worked, now to try to migrate it back to Hardy.

vzmigrate --online -r no 192.168.2.44 733
OPT:--online
OPT:-r
OPT:192.168.2.44
Starting online migration of VE 733 on 192.168.2.44
Preparing remote node
/usr/sbin/vzmigrate: line 382: [: missing `]'
Initializing remote quota
Syncing private
Live migrating VE
Syncing 2nd level quota
Error: Failed to undump VE
vzquota : (error) Quota is not running for id 733

OK that didn't work so let's checkpoint it and try to restore on the other system.

vzctl chkpnt 733 --dumpfile /tmp/733
Setting up checkpoint...
suspend...
dump...
kill...
VE is unmounted
Checkpointing completed succesfully
[root@server1 root]# lst /tmp/733
-rw------- 1 root root 517448 Jul 30 07:14 /tmp/733
[root@server1 root]# scp /tmp/733 192.168.2.44:
733 100% 505KB 505.3KB/s 00:00

We're half way there!

vzctl restore 733 --undump --dumpfile 733
VE config file does not exist

So whay isn't there a config file? Oh well, that's easy enough to fix.

scp 192.168.2.250:/etc/vz/conf/733.conf /etc/vz/conf

733.conf 100% 1632 1.6KB/s 00:00
root@chinaberry:/root# ls -l /etc/vz/conf/733.conf
-rw-r--r-- 1 root root 1632 2008-07-30 07:43 /etc/vz/conf/733.conf
root@chinaberry:/root# vzctl restore 733 --undump --dumpfile 733
Restoring VE ...
Starting VE ...
VE private area /vz/private/733 does not exist
root@chinaberry:/root# mkdir /vz/private/733
root@chinaberry:/root# vzctl restore 733 --undump --dumpfile 733
Restoring VE ...
Starting VE ...
Initializing quota ...
VE is mounted
undump...
Error: undump failed: Invalid argument
Restoring failed:
Error: HZ mismatch: 1000 != 100
VE start failed
VE is unmounted

I'm tired of trying things that don't work. Can someone help me get yum installed on a centos 4 minimal template running on a Hardy VE0 platform?

Thanks,
Jim.

"I'm not paranoid, and this proves it, the world is against me!!"

[Updated on: Tue, 05 August 2008 23:00]

Report message to a moderator

Re: Can't install yum on container. [message #32302 is a reply to message #32287] Wed, 30 July 2008 13:30 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

you've done a lot of work and got a lot of problems Smile

1.

Quote:


vzyum 733 install yum
ERROR: vzrpm43 path not found: /usr/share/vzpkgtools/vzrpm43
ERROR: RPM python path not found: /lib/python2.4/site-packages


I guess you should install this http://wiki.openvz.org/Download/vzrpm43/4.3.3-7_nonptl.6
utilities.

2.

Quote:


OK so I noticed that rpm was 44 not 43, so I changed the /vz/template/centos/4/i386/config/rpm to 44 from 43. I have no idea who maintains that file since it isn't in any package according to rpm -qf.



root@host:~# rpm -qf /vz/template/centos/4/i386/config/rpm
vztmpl-centos-4-2.0-2


Quote:


I changed the /vz/template/centos/4/i386/config/rpm to 44 from 43


I doubt that it should have been done.

I really hope that the first and the second points help to solve first problem.

3.
Quote:


vzmigrate --online -r no 192.168.2.44 733
OPT:--online
OPT:-r
OPT:192.168.2.44
Starting online migration of VE 733 on 192.168.2.44
Preparing remote node
/usr/sbin/vzmigrate: line 382: [: missing `]'
Initializing remote quota
Syncing private
Live migrating VE
Syncing 2nd level quota
Error: Failed to undump VE
vzquota : (error) Quota is not running for id 733



Could you do that command with -v option but I think that you've pointed out the problem:

Quote:


root@chinaberry:/root# vzctl restore 733 --undump --dumpfile 733
Restoring VE ...
Starting VE ...
Initializing quota ...
VE is mounted
undump...
Error: undump failed: Invalid argument
Restoring failed:
Error: HZ mismatch: 1000 != 100
VE start failed
VE is unmounted



HZ mismatch can cause the problem.
If it is possible you can recompile the kernel.

4. Anyway I came across this thread nad think it could be very useful in this case.
http://forum.openvz.org/index.php?t=msg&th=4134&star t=0&
Unfortunately I don't try that but hope it works.


Re: Can't install yum on container. [message #32324 is a reply to message #32287] Thu, 31 July 2008 19:04 Go to previous messageGo to next message
dowdle is currently offline  dowdle
Messages: 261
Registered: December 2005
Location: Bozeman, Montana
Senior Member
If you can't get vzyum to work (which is problematic on newer system, especially x86_64), you can manually install yum inside of your container using rpm.

If your container is new and you don't care about destroying it and starting over, you can use one of the contributed pre-created OS Templates I've created (that I'm trying to keep updated by uploading a new one once a month) that has yum already installed.

For manually installing yum into your container see the following wiki article:

http://wiki.openvz.org/Install_yum

That might be a little outdated if any of the packages have been updated... so find a CentOS repository and copy the links to the packages. Oh, and you don't have to do a separate rpm -ivh for each individual package... you can do them all at once. Just put a space between package names. If the package list is incomplete and it stills throws up some unresolved dependencies (rpm doesn't resolve deps), then you just need to keep tacking on all of the needed packages until you have everything. I have used that recipe from the wiki and it worked for me.

If you want my contributed pre-created OS Templates, see here:

http://download.openvz.org/template/precreated/contrib/

They are the CentOS (and Fedora) files with dates as part of the filenames... and are current as of the date given (last Friday when I wrote this).


--
TYL, Scott Dowdle
Belgrade, Montana, USA
Re: Can't install yum on container. [message #32381 is a reply to message #32302] Mon, 04 August 2008 20:19 Go to previous messageGo to next message
JimL is currently offline  JimL
Messages: 116
Registered: February 2007
Senior Member
maratrus wrote on Wed, 30 July 2008 09:30

Hi,



4. Anyway I came across this thread nad think it could be very useful in this case.
http://forum.openvz.org/index.php?t=msg&th=4134&star t=0&
Unfortunately I don't try that but hope it works.




That was the trick. I did have to install a half dozen other packages to satisfy dependencies, but eventually that worked.

To document what I did in hopes it will help others, here's the script I used to successfully install yum:

rpm -Uvh  http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/gmp-4.1.4-3.i386.rpm
rpm -Uvh  http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/readline-4.3-13.i386.rpm 
rpm -Uvh  http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-2.3.4-14.4.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/libxml2-2.6.16-10.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/libxml2-python-2.6.16-10.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/expat-1.95.7-4.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-elementtree-1.2.6-5.el4.centos.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/elfutils-libelf-0.97.1-5.i386.rpm 
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/centos-release-4-4.4.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/elfutils-0.97.1-5.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/rpm-4.3.3-23_nonptl.i386.rpm 

rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/rpm-python-4.3.3-23_nonptl.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-urlgrabber-2.9.8-2.noarch.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/yum-metadata-parser-1.0-8.el4.centos.i386.rpm
rpm -Uvh http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/yum-2.4.3-4.el4.centos.noarch.rpm
yum -y update


This was for a Centos 4.4 system.

Thanks,
Jim.
icon14.gif  Re: Can't install yum on container. [message #32382 is a reply to message #32324] Mon, 04 August 2008 20:22 Go to previous messageGo to next message
JimL is currently offline  JimL
Messages: 116
Registered: February 2007
Senior Member
Thanks, eventually the manual install worked as I reported in a previous message.

And thanks a bunch for your efforts in maintaining the precreated templates. Very Happy I've used a few and really appreciate them. I didn't know before who to thank.

Regards,
Jim
Re: Can't install yum on container. [message #32385 is a reply to message #32381] Mon, 04 August 2008 22:25 Go to previous messageGo to next message
dowdle is currently offline  dowdle
Messages: 261
Registered: December 2005
Location: Bozeman, Montana
Senior Member
That was quite painful... because your OS Template was for CentOS 4.4 and you had to find 4.4 packages. 4.6 is the current CentOS release and I think all OS Templates should be as current as possible. 4.7 comes out any-day now.

My dated contrib OS Templates are current as of the dates in the names.


--
TYL, Scott Dowdle
Belgrade, Montana, USA
Re: Can't install yum on container. [message #32388 is a reply to message #32385] Mon, 04 August 2008 23:00 Go to previous messageGo to next message
JimL is currently offline  JimL
Messages: 116
Registered: February 2007
Senior Member
dowdle wrote on Mon, 04 August 2008 18:25

That was quite painful... because your OS Template was for CentOS 4.4 and you had to find 4.4 packages. 4.6 is the current CentOS release and I think all OS Templates should be as current as possible. 4.7 comes out any-day now.

My dated contrib OS Templates are current as of the dates in the names.


Yes, unfortunately I'm running a test platform and it has to run the same OS as the production environment. Updating the production environment is something we don't like to do very often.

Thanks again,
Jim.
Re: Can't install yum on container. [message #32389 is a reply to message #32388] Mon, 04 August 2008 23:40 Go to previous message
dowdle is currently offline  dowdle
Messages: 261
Registered: December 2005
Location: Bozeman, Montana
Senior Member
Well, part of the "Enterprise" distro concept is that the updates are totally compatible and pain free so I don't recommend hovering at an older version.

Of course that is outside the scope of OpenVZ and your mileage may vary.


--
TYL, Scott Dowdle
Belgrade, Montana, USA
Previous Topic: OpenVZ & RAID
Next Topic: Redirect traffic from a specific hostame to a specific VE ?
Goto Forum:
  


Current Time: Wed Nov 13 15:14:08 GMT 2024

Total time taken to generate the page: 0.02931 seconds