LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 07-26-2013, 04:18 PM   #1
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 547

Rep: Reputation: 72
64-bit host 32-bit chroot and Yum


I've successfully configured a chroot jail on a CentOS6 64-bit server using 32-bit packages from http://mirror.centos.org/centos-6/6/os/i386/Packages/.

I've got yum package installed too.

However, when I use yum, it wants to pull x86_64 bit packages for everything. I specifically need to keep the entire chroot 32-bit.

I tried setting the arch and basearch variables as documented here: https://access.redhat.com/site/docum...Variables.html

But, it still is demanding the 64-bit packages. I've even altered the repo config to discourage it. But, still no luck.

Any clues how to force yum inside the chroot to use 32-bit packages would be appreciated.
 
Old 07-29-2013, 10:53 PM   #2
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,132

Rep: Reputation: 158Reputation: 158
Wouldn't it be better to create a virtual machine?
 
Old 07-30-2013, 12:53 PM   #3
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 547

Original Poster
Rep: Reputation: 72
Quote:
Originally Posted by stormtracknole View Post
Wouldn't it be better to create a virtual machine?
In this case, for many reasons, no.
 
Old 08-20-2014, 10:17 AM   #4
jefftk
LQ Newbie
 
Registered: Aug 2014
Posts: 2

Rep: Reputation: Disabled
To see what arch yum thinks you have, you can do:

Code:
/usr/bin/python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'
Looking at /rpmUtils/arch.py it looks like yum is reading /etc/rpm/platform to get the arch. To fool it:

Code:
$ sudo cp /etc/rpm/platform /etc/rpm/platform.real
$ echo i686-redhat-linux | sudo tee /etc/rpm/platform
run yum commands to set up your chroot
$ sudo mv /etc/rpm/platform.real /etc/rpm/platform
When I tried to run
Code:
yum
inside the chroot I got:

Code:
Loaded plugins: fastestmirror
rpmdb: Program version 4.3 doesn't match environment version
error: db4 error(-30974) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 309, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 157, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 187, in getOptionsConfig
    self.conf
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 665, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 240, in _getConfig
    self._conf = config.readMainConfig(startupconf)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 805, in readMainConfig
    yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 878, in _getsysver
    idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed
Removing the database files fixed this, though I'm not confident this was the right solution:

Code:
# rm /var/lib/rpm/__db.00*
 
Old 08-20-2014, 10:23 PM   #5
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
I think there is a simple setting in yum.conf. I can look a bit later.
 
Old 08-20-2014, 10:32 PM   #6
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
Be sure to list the arch when running yum. If you don't include the arch, it will try to pull native arch.

Have you tried this?

~~~
# vim /etc/yum.conf
protected_multilib=0
~~~

Then try to install. If that fails, look here:

http://serverfault.com/questions/512...-64-bit-centos

I have had luck on CentOS in the past using the Compatibility Libraries (see link above).
 
Old 08-21-2014, 06:32 AM   #7
jefftk
LQ Newbie
 
Registered: Aug 2014
Posts: 2

Rep: Reputation: Disabled
You only have to do the /etc/rpm/platform trick when running the yum commands from outside your chroot to install the packages for the base system. After you've chrooted in you can use yum like normal because /etc/rpm/platform inside the chroot will say i686.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto install 32-bit libraries on 64-bit Linux using yum shawn_t Linux - Server 16 07-13-2012 02:46 AM
64-bit VirtualBox host running a single 32-bit guest, good idea? FireRaven Linux - Virtualization and Cloud 10 04-03-2010 03:21 PM
[SOLVED] Assistance needed to set up RHEL 64-bit as a YUM Proxy server for 32-bit also. xenner Linux - Newbie 7 10-19-2009 08:50 PM
xen virtualization host OS is 64 bit but cant install 32 bit guest OS hackintosh Linux - Server 0 12-26-2007 03:09 AM
no sound in 32 bit chroot on 64 bit system <solved> otchie1 Linux - Software 0 11-28-2006 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 12:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration