can't upgrade libc6 (hardy64)

Asked by stinkinrich88

Hello,

I downloaded the buggy update of libc6 and it crashed my computer and I had to boot to a live CD and follow loads of instructions from the forums involving things like extracting data from libc6 .debs and copying them into the root directory. I only realised after that these .debs were for 32 bit and I'm running 64 bit. Anyway, I solved the problem in the end but now I can't update the libc6 package. when I try it just says the following:

sudo apt-get -f install libc6
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  glibc-doc
The following packages will be upgraded:
  libc6
1 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
Need to get 0B/4738kB of archives.
After this operation, 20.5kB disk space will be freed.
Preconfiguring packages ...
(Reading database ... 104366 files and directories currently installed.)
Preparing to replace libc6 2.7-9ubuntu1 (using .../libc6_2.7-9ubuntu2_amd64.deb) ...

A non-dpkg owned copy of the libc6-i686 package was found.
It is not safe to upgrade the C library in this situation;
please remove that copy of the C library and try again.
dpkg: error processing /var/cache/apt/archives/libc6_2.7-9ubuntu2_amd64.deb (--unpack):
 subprocess pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/libc6_2.7-9ubuntu2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

any help is really appreciated. thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Di Gioia
Solved:
Last query:
Last reply:
Revision history for this message
Best Robert Di Gioia (digioiar) said :
#1

Hi

Sounds like the last post on this page may help you.

http://www.debianhelp.org/node/12820

Good luck

Revision history for this message
stinkinrich88 (stinkinrich88) said :
#2

ahh thank you very much!

I first unpacked the libc6 .deb file (/var/cache/apt/archives/libc6_2.7-9ubuntu"_amd64.deb)
unpacked control.tar.gz from inside it to read preinst.
Searched preinst for the error message I was getting and found this:

if [ -e /lib/tls/i686/cmov/libc.so.6 ] || [ -e /lib/i686/cmov/libc.so.6 ] ; then
    status_i686=$(dpkg -s libc6-i686 2>/dev/null | grep ^Status: | sed -e 's/^Status: \(.*\) \(.*\) \(.*\)/\3/g')
    status_xen=$(dpkg -s libc6-xen 2>/dev/null | grep ^Status: | sed -e 's/^Status: \(.*\) \(.*\) \(.*\)/\3/g')
    if ([ -z "$status_i686" ] || [ "$status_i686" = "not-installed" ] || [ "$status_i686" = "config-files" ]) && \
       ([ -z "$status_xen" ] || [ "$status_xen" = "not-installed" ] || [ "$status_xen" = "config-files" ]); then
      echo
      echo "A non-dpkg owned copy of the libc6-i686 package was found."
      echo "It is not safe to upgrade the C library in this situation;"
      echo "please remove that copy of the C library and try again."
      exit 1
    fi
  fi

so then I :

cd /lib/tls/i686/cmov/
sudo mv libc.so.6 libc.so.6.bkup
sudo apt-get install -f libc6

and it was all sorted! Thank you very much!

Revision history for this message
stinkinrich88 (stinkinrich88) said :
#3

Thanks Robert Di Gioia, that solved my question.

Revision history for this message
nigratruo (nigratruo) said :
#4

Dangerous, very dangerous!!!!

I just want to warn other users.. It crashed my system, after doing

sudo mv libc.so.6 libc.so.6.bkup

all my system is putting out is:

error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

I cannot install, move, copy or do anything at all. Not even shutdown works. I am pretty sure what will greet me when the system does go down. Unbootable, unusable. Not funny, really!

Please warn before posting such dangerous and irreversible "solutions".

Markus

Revision history for this message
nigratruo (nigratruo) said :
#5

I actually will have to pull the power plug, since the system does not repond to anything. Libc is ESSENTIAL to any Linux system, you don't just remove it. It is like removing the world, you will be floating in Space and suffocate.

Anytime you have to pull the plug or hold the power button, since nothing else works, something went very very very wrong!

Now I can do a recover from another media. I can't believe that I did not think more about this solution of yours before executing it.

Revision history for this message
Stefan (s-launchpad-infocrew) said :
#6

Upon having the same problem, I followed these instructions (within a root shell opened by sudo bash):
cd /lib/tls/i686/cmov
mv libc.so.6 libc.so.6.moved
apt-get -f install

and it worked fine for me (on a somehow broken Ubuntu 10.04 installation, 32bit).