Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I tried to update a system of mine, with which I had no problems whatsoever, and ran into problem while executing a aptitude full-upgrade. The update ran through normally till I got this error :

 Preparing to replace libc6 2.13-21 (using .../libc6_2.13-24_amd64.deb) ...

A copy of the C library was found in an unexpected directory:
  '/lib/ld-2.11.2.so'
It is not safe to upgrade the C library in this situation;
please remove that copy of the C library or get it out of
'/lib' and try again.

dpkg: error processing /var/cache/apt/archives/libc6_2.13-24_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
configured to not write apport reports
                                      Errors were encountered while processing:
 /var/cache/apt/archives/libc6_2.13-24_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
dpkg: dependency problems prevent configuration of libc6-dev:
 libc6-dev depends on libc6 (= 2.13-24); however:
  Version of libc6 on system is 2.13-21.
dpkg: error processing libc6-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc6-i386:
 libc6-i386 depends on libc6 (= 2.13-24); however:
  Version of libc6 on system is 2.13-21.
dpkg: error processing libc6-i386 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libc6-dev
 libc6-i386

Anytime now that I try to upgrade or install any package I get this error. Any attempts to move files only required more files to be moved. I also couldn't fix with dpkg.

Some Info :

Debian Linux 3.1.0-1-amd64
#dpkg -l | grep libc6
ii  libc6                                2.13-21                       
iU  libc6-dev                            2.13-24                        
iU  libc6-i386                           2.13-24    

Thank you !

share|improve this question
    
Have you skipped a version of debian? –  pjc50 Jan 11 '12 at 16:49
    
2.13-21 -> 2.13-24 looks like you're upgrading within unstable or testing. /lib/ld-2.11.2.so exists in stable; I think it should have been removed at some point in the upgrade chain. You will probably find that 'dpkg -S ld-2.11.2.so' reveals it not to be in any package. Can you confirm that? –  Richard Kettlewell Jan 11 '12 at 16:57
    
@pjc50 No, I just didn't update my system for about 3 weeks –  cete3 Jan 14 '12 at 16:55
    
@RichardKettlewell You are right, the output of the command is "dpkg-query: no path found matching pattern ld-2.11.2.so" –  cete3 Jan 14 '12 at 16:56
    
since this is one of the top Google hits for the error message, I'm posting this to tell Knoppix users who encounter this to look here: knoppix.net/forum/threads/… –  jcomeau_ictx May 14 '13 at 23:27
add comment

2 Answers

up vote 1 down vote accepted

Following the comment response...

Start by checking that when you run a program you get a copy of the dynamic linker that does not involve that path. You should see:

$ ldd /bin/ls | grep ld-linux
    /lib64/ld-linux-x86-64.so.2 (0x00007fc695aef000)

(The hex address may differ.) This file should be a symlink pointing to /lib/x86_64-linux-gnu/ld-2.13.so which should not be a symlink and certainly shouldn’t end up at ld-2.11.2.so.

Assuming this all looks right it should be safe to go ahead and rename /lib/ld-2.11.2.so out of the way (though I would have rescue media to hand nevertheless). Don’t delete it until you’re sure everything’s still OK, in case it turns out that you need to put it back!

You may well find there are complaints about other leftover files, which can be check and dealt with in much the same way.

Obviously this advice is not directly tested!

share|improve this answer
add comment

I had this problem. . .finally fixed it by

  1. chroot-ing into the damaged/ stalled system, where I
  2. mv'ed a bunch of lib.so's out of lib/i38 into a temp folder in that partitions /root and
  3. creating symlinks to each of these. At this point it became possible to
  4. boot into that partition and then
  5. upgrade as usual. ( The exact list of files does not spring to mind and will anyway probably vary from system to system - it included the GNU-threads lib and some others, each of which raised the dreaded - lib in unexpected location message) After the upgrade the new libs will be in the usual /lib/i386( or your equivalent) and the LSB dependency boot will have created fresh symlinks for you. When satisfied that all is well you can then destroy the temp folder and the .so's moved there earlier. Hope this may help...
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.