[Lxc-users] [SOLVED] Remedy for centos base installation failing operations on /sys?

Serge Hallyn serge.hallyn at canonical.com
Wed Jul 25 11:36:16 UTC 2012


Quoting Johannes Graumann (johannes_graumann at web.de):
> Fajar A. Nugraha wrote:
> 
> > On Tue, Jul 24, 2012 at 4:20 AM, Fajar A. Nugraha
> > <list at fajar.net> wrote:
> >> On Mon, Jul 23, 2012 at 6:15 PM, Johannes Graumann
> >> <johannes_graumann at web.de> wrote:
> >>> On the container "/var/lib/rpm is now empty
> >>
> >> That is not right. It might be the source of your problem. Try
> >>
> >> yum --installroot=/some/path/of/your/choice groupinstall base
> >>
> >> ... and verify whether /var/lib/rpm under that path has some files (it
> >> should). Just to check whether the problem is in your template, or in
> >> your version of yum.
> > 
> > I think I know what happens.
> > 
> > Debian/Ubuntu's version of yum stores rpm database in /root/.rpm (when
> > run as root). RHEL/Centos expects the db to be on /var/lib/rpm. Thus
> > the problem.
> > 
> > You can simply (in chroot or container) move all content in /root/.rpm
> > to /var/lib/rpm, and the run "rpm --rebuilddb" .
> > 
> > Strangely enough, eventhough your install process installs
> > "filesystem" as a dependency, yum won't complain much if you can run
> > "yum erase filesystem" inside the chroot environment :P. Not
> > recommended though.
> 
> For the benefit of others (the mailing list refused my email replies in much 
> of this conversation): this problem is solved by doing the following as root 
> on the container:
> 
> PROMPT> cp -r /root/.rpmdb/* /var/lib/rpm/
> PROMPT> rpm --define '_dbapi 3' --rebuilddb

Thanks for the info, Johannes.

Would you be interested in creating a proper /usr/lib/lxc/templates/lxc-centos
template (which would check for this condition)?  You said you used an openvz
template to start right?

> Debian puts the database away in a user-specific directory and uses a 
> different db format ...

thanks,
-serge




More information about the lxc-users mailing list