Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I wanted to upgrade the unetbootin package this morning. It was going well until I got this error.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libc6 : Breaks: libc6:i386 (!= 2.17-0ubuntu5) but 2.17-0ubuntu5.1 is installed
 libc6:i386 : Breaks: libc6 (!= 2.17-0ubuntu5.1) but 2.17-0ubuntu5 is installed
 libc6-dbg : Depends: libc6 (= 2.17-0ubuntu5.1) but 2.17-0ubuntu5 is installed
 libc6-dev : Depends: libc6 (= 2.17-0ubuntu5.1) but 2.17-0ubuntu5 is installed
             Depends: libc-dev-bin (= 2.17-0ubuntu5.1)
 libc6-dev:i386 : Depends: libc-dev-bin:i386 (= 2.17-0ubuntu5.1)
                  Recommends: gcc:i386 but it is not installed or
                              c-compiler:i386
 libc6-i386 : Depends: libc6 (= 2.17-0ubuntu5.1) but 2.17-0ubuntu5 is installed
 libc6-x32 : Depends: libc6 (= 2.17-0ubuntu5.1) but 2.17-0ubuntu5 is installed
E: Unmet dependencies. Try using -f.

So I did tried the suggested apt-get -f install

But that resulted in the following error

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.2.0-31 linux-headers-3.2.0-31-generic linux-headers-3.8.0-19
  linux-headers-3.8.0-19-generic python-central
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libc-dev-bin libc6
Suggested packages:
  glibc-doc
The following packages will be upgraded:
  libc-dev-bin libc6
2 upgraded, 0 newly installed, 0 to remove and 109 not upgraded.
8 not fully installed or removed.
Need to get 0 B/4,814 kB of archives.
After this operation, 6,144 B of additional disk space will be used.
Do you want to continue [Y/n]? 
Preconfiguring packages ...
(Reading database ... 661066 files and directories currently installed.)
Preparing to replace libc6:amd64 2.17-0ubuntu5 (using .../libc6_2.17-0ubuntu5.1_amd64.deb) ...

A copy of the C library was found in an unexpected directory:
  '/lib/x86_64-linux-gnu/libc-2.15.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/x86_64-linux-gnu' and try again.

dpkg: error processing /var/cache/apt/archives/libc6_2.17-0ubuntu5.1_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/libc6_2.17-0ubuntu5.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried apt-get clean apt-get update && apt-get upgrade

But that didn't help either. The same errors are occurring. I'm a little uncertain as to whether I dare to reboot. How do I fix this?


Output of apt-cache policy libc6

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libc6 : Breaks: libc6:i386 (!= 2.17-0ubuntu5) but 2.17-0ubuntu5.1 is installed
 libc6:i386 : Breaks: libc6 (!= 2.17-0ubuntu5.1) but 2.17-0ubuntu5 is installed
 libc6-dbg : Depends: libc6 (= 2.17-0ubuntu5.1) but 2.17-0ubuntu5 is installed
 libc6-dev : Depends: libc6 (= 2.17-0ubuntu5.1) but 2.17-0ubuntu5 is installed
             Depends: libc-dev-bin (= 2.17-0ubuntu5.1)
 libc6-dev:i386 : Depends: libc-dev-bin:i386 (= 2.17-0ubuntu5.1)
                  Recommends: gcc:i386 but it is not installed or
                              c-compiler:i386
 libc6-i386 : Depends: libc6 (= 2.17-0ubuntu5.1) but 2.17-0ubuntu5 is installed
 libc6-x32 : Depends: libc6 (= 2.17-0ubuntu5.1) but 2.17-0ubuntu5 is installed
E: Unmet dependencies. Try using -f.
share|improve this question
    
What is the output of apt-cache policy libc6? –  Braiam Nov 24 '13 at 22:48

2 Answers 2

up vote 2 down vote accepted

First of all go here /lib/x86_64-linux-gnu move these files to /root: libc-2.17.so libdl-2.17.so libm-2.17.so libpthread-2.17.so librt-2.17.so

Commands to go into the directory /lib/x86_64-linux-gnu and copy the files to /root,

sudo -s
cd /lib/x86_64-linux-gnu
cp libc-2.17.so /root
cp libdl-2.17.so /root
cp libm-2.17.so /root
cp libpthread-2.17.so /root
cp librt-2.17.so /root

Then you need to launch bash with predefined LD_PRELOAD:

LD_PRELOAD=/root/libc-2.17.so:/root/libdl-2.17.so:/root/libm-2.17.so:/root/libpthread-2.17.so:/root/librt-2.17.so bash

Commands to remove the files in /lib/x86_64-linux-gnu directory,

rm libc-2.17.so
rm libdl-2.17.so
rm libm-2.17.so
rm libpthread-2.17.so
rm librt-2.17.so

after that dist-upgrade or fix-missing package will works:

apt-get -f install

OR

apt-get -f dist-upgrade
share|improve this answer
    
apt-get fails. But if I did the PRELOAD trick with it then I was able to install process to complete. also dist-upgrade isn't what I wanted to do just a plain install. –  Matt H Nov 24 '13 at 23:37
    
it works or not. –  Avinash Raj Nov 24 '13 at 23:38
    
I also had to issue "sudo -s" before running PRELOAD with sudo or else it couldn't read from /root. Thanks though that method was pretty close to what I wanted. –  Matt H Nov 24 '13 at 23:39
    
I actually edited your answer but it's in peer review. –  Matt H Nov 24 '13 at 23:51

Thanks Avinash Raj!

I have fix this issue by following your method. But with minor edit of your method:

  1. sudo

    cd /lib/x86_64-linux-gnu cp libc-2.17.so /root cp libdl-2.17.so /root cp libm-2.17.so /root cp libpthread-2.17.so /root cp librt-2.17.so /root cp ld-2.17.so /root/

mkdir /root/i386

and cd /lib/i386-linux-gnu cp libc-2.17.so /root/i386 cp libdl-2.17.so /root/i386 cp libm-2.17.so /root/i386 cp libpthread-2.17.so /root/i386 cp librt-2.17.so /root/i386 cp ld-2.17.so /root/i386

  1. Preload: LD_PRELOAD=/root/libc-2.17.so:/root/libdl-2.17.so:/root/libm-2.17.so:/root/libpthread-2.17.so:/root/librt-2.17.so bash

  2. remove libs: cd /lib/i386-linux-gnu rm libc-2.17.so rm libdl-2.17.so rm libm-2.17.so rm libpthread-2.17.so rm librt-2.17.so rm ld-2.17.so

cd /lib/x86_64-linux-gnu/ rm libc-2.17.so rm libdl-2.17.so rm libm-2.17.so rm libpthread-2.17.so rm librt-2.17.so rm ld-2.17.so

  1. apt-get -f install I meet error when exec this command "Cannot find file lib6" I recovery it from by: dpkg -i /var/cache/apt/archives/*.deb and dpkg --configure -a

  2. then I can do the dist-upgrade. apt-get dist-upgrade

share|improve this answer

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.