Bug 98975

Summary: rpm failure : need help
Product: [Retired] Red Hat Linux Reporter: Van <k_tgiang>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: high Docs Contact:
Priority: high    
Version: 8.0CC: leonard-rh-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-04-19 19:02:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Van 2003-07-11 08:59:51 UTC
Description of problem:
  Due to a chain of reasons that I had my kernel-2.4.18-14 of RH8 (Psyche) 
upgraded to kernel-2.4.20-8 (mostly because of java SDK 2, version 1.4.2). 
After done that I couldn't install oprofile-*.rpm package with the error:
  ...
  Preparing         ############################################[100%]
  can't handle file 'libc.so.6' with TLS data

Frozen...but found out later a method to solve it, at least some did say they 
solved it. So, I follow suit :
  >cd /
  >rpm2cpio ~van/rpmdirs | cpio -ivd  
  # note : rmpdirs dir has rpm-*.rpm and elfutils-*.rpm packages and others
  # and those rpm- are version 4.2 of RH9
  >rm -f /var/lib/rpm/_db.00*
  >ldconfig -vv
  >cd ~van/rpmdirs
  >rpm -Uvh [all packages already haved dependencies resolved - long list of 
rpm files]

Problem arises : it gives me (no mercy) the following :
  rpm: error while loading shared libraries: libelf.so.1 cannot open shared 
object file. No such file or directory

Indeed, I managed to use ">locate libelf", I end up with "libefl.so.0" but no 
such file as "libelf.so.1", ( I already updatedb my slocate database, so I bet 
it gives accurate search result ).
  Now, I can't do anything with rpm, rpm2cpio or even rpm --initdb or --
rebuilddb options.

  Would you please tell me what's going on? What I have to do to bring my 
shared libraries "back online"? Oh, for the record, I tried to restart the 
computer and found that those _db.00* were still there. I wonder how those 
database files could be constructed when rpm was already dead? Currently, 
solutions other guru have used to solve the "libc.so.6 file handling TLS data" 
have not worked for me. I heard about setting environment to ASSUME_KERNEL_ or 
something. If that might work, plz tell me how since I will be willing to try 
out.


Version-Release number of selected component (if applicable):


How reproducible: I was using pure RH8 (psyche), but to run j2sdk-1_4_2 
version, I need to upgrade to kernel beyond 2.4.20 to avoid runtime errors. Of 
course, to do that requires a lot of packages upgrade. Then problem with 
installing oprofile-0.4-44.i386.rpm package ( with error of TLS data ). So, I 
intend to upgrade rpm instead. ( I guess it's a bad move ). Then, it involves 
a lot of packages upgrade. Once I finally came to the point of having all 
dependencies resolved, I ended up with "error loading share libraries" as 
mentioned above.


Steps to Reproduce:
1. cd /
2. rpm2cpio [dirToUpdatedRPMSPackages] | cpio -ivd
3. rm -f /var/lib/rpm/_db.00*
4. /sbin/ldconfig -vv
5. cd [dirToUpdatedRPMSPackages]
6. rpm -Uvh *.rpm

Error : "rpm : error while loading shared libraries : libelf.so.1 cannot open 
shared object file : No such file or directory" 
    
Actual results:


Expected results:
  Updated version of rpm might solve some problems in rpm version of RH8 as 
heard from other RH users ( read online of course ). It turns out not quite!!!

Additional info:

Comment 1 Jeff Johnson 2003-07-11 16:26:21 UTC
Yup, mixing and matching kernel/glibc/rpm leads to some
painful surprises these days.

Basically you need to decide whether you want NPTL/TLS/futexes.

If you do want them (i.e. you're mostly RHL9), then you want
versions and updates and rpm from RHL9. This translates to
you want rpm-4.2.

Otherwise (i.e. you're mostly RHL8.0) then you want to get
packages/updates/rpm from RHL 8.0. This translates to rpm-4.1.1.

So figure out whether you want 4.2 or 4.1.1 (they're the same
code base, built differently).

Download all the packages (don't forget popt) for either rpm-4.2
or rpm-4.1.1 from
    ftp://ftp.rpm.org/pub/rpm/dist
into var tmp, and install manually by doing (as root)

    cd /var/tmp
    mkdir xxx
    cd xxx
    for i in ../{rpm,popt}-*.rpm; then
        /usr/lib/rpm/rpm2cpio.sh $i | cpio -dim
    done
    find . -type d -exec chmod 0755 {} \;
    tar cf - . | (cd /; tar xvf -)
    rm -f /var/lib/rpm/__db*
    rpm --rebuilddb -vv
    cd /var/tmp
    rpm -Uvh {rpm,popt}-*.rpm

Comment 2 Van 2003-07-16 18:56:48 UTC
  I followed what you suggested to switch to rpm4.2, but there are couple of 
problems on the way:
  for i in ../{rpm,popt}-*.rpm; then /usr/lib/rpm/rpm2cpio.sh $i | cpio -dim 
fails due to syntax error, which I am not familiar with. So, instead I tried :
  /usr/lib/rpm/rpm2cpio.sh ../{rpm,popt}-*.rpm $i | cpio -dim
which turns out fine. Then, I follow the rest of the steps, but up to :
  rpm --rebuild -vv
it gives me the same old error : "rpm: error while loading shared libraries: 
libelf.so.1: cannot open shared object file: No such file or directory". I 
notice there are new created dirs in the xxx dir too, but somehow it doesn't 
work.

  What should I do then? By the way, I am using <bash> if it helps. 
  The reason I insist on rpm4.2 is that even though I upgraded to kernel-
2.4.20, java still causes runtime errors where the docs of java mention 
otherwise. So, I thought making everything compatible for kernel-2.4 would be 
helpful since I assume there must be changes in kernel-2.4.20's compilers. If 
you have any information about this, plz feed me :-)

  thanks.

-van

Comment 3 Van 2003-07-19 21:23:56 UTC
  I managed to try couple of times, this time I follow the command in bash:

  for i in ../{rpm;popt}-*.rpm; do /usr/lib/rpm/rpm2cpio.sh $i | cpio -dim;done

which works fine. But then,

  rpm --rebuilddb -vv ( or any rpm command )
gives the following error: "bash: /bin/rpm: Cannot execute binary file"

  any idea?
(I forgot to reopen bug last time, so you might have 2 comments session).

thanks.

-van

Comment 4 Jeff Johnson 2003-07-29 13:17:09 UTC
What do
   ls -al /bin/rpm
and
    file /bin/rpm
say?


Comment 5 Leonard den Ottolander 2004-04-14 16:29:31 UTC
Seems like this issue is somewhat outside of the scope of the
distribution (mixed versions) and the issues are expected.

WONTFIX? NOTABUG?