[Yum] _rpm.error: rpmdb open failed

Russell Jones russell at jonesmail.me
Fri Jul 5 22:35:12 UTC 2013


On 7/5/2013 4:50 PM, Fajar A. Nugraha wrote:
> On Sat, Jul 6, 2013 at 2:27 AM, Russell Jones <russell at jonesmail.me 
> <mailto:russell at jonesmail.me>> wrote:
>
>     This is installing into a separate install root (via
>     --installroot), not the base system itself. This is then later
>     used to create diskless PXE boot images for booting client systems.
>
>     This works fine on CentOS 6.3, but as you can see generates that
>     error on CentOS 6.4. Trying to get the node used to create these
>     images up to CentOS 6.4 if I can.
>
>
> Short version: Don't.
>
> Long version:
> There are enough differences in Berkeley db versions used in 
> RHEL/Centos 5.x and 6.x in that even if your comand succeeded, you 
> will NOT be able to correctly run rpm/yum from INSIDE the 
> newly-created 5.x images.
>
> There's a workaround though:
> - run your command once, or create a simple 5.x image which only 
> contains yum
> - chroot inside that image (even if you have the error you mentioned), 
> and re-run the command to create a second 5.x image. This time it's 
> run using 5.x's version of yum and bdb, so you should not get the error.
> - move the second image outside of the first one
> - delete the first one
>
> An example of how that's done is on 
> https://github.com/fajarnugraha/lxc/blob/centos-template/templates/lxc-centos.in (search 
> "download_centos"). It does "yum --installroot install", then check 
> two things:
> - is rpmdb located under $HOME (as is the case when run under 
> debian/ubuntu). If yes, then move it to /var/lib/rpm (the correct 
> place for RHEL/Centos)
> - does rpm command works inside the new image (checked with rpm -q 
> yum). If not, then re-run the "yum install" command from inside the image
>
> The template was tested to create Centos 5 and 6 images on latest 
> Ubuntu (which should have similar rpm/yum/bdb version as centos 6.x), 
> and can create good centos 5.x and 6.x images.
>
> -- 
> Fajar
>


Got it. Makes sense, thank you!


>
> _______________________________________________
> Yum mailing list
> Yum at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.baseurl.org/pipermail/yum/attachments/20130705/e224fef4/attachment.html>


More information about the Yum mailing list