apt-get fails at libc6 upgrade with "A copy of the C library was found in an unexpected directory" error message

Bug #980573 reported by prodigel on 2012-04-13
46
This bug affects 7 people
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
Undecided
Unassigned

Bug Description

I've upgraded to 12.04 since a couple of weeks ago, since then I've periodically updated/dist-upgraded my system.

The latest attempt fails with the next behavior:

apt-get update - all goes well

When trying apt-get dist-upgrade I get this:
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 : Depends: libc-bin (= 2.15-0ubuntu6)
         Breaks: libc6:i386 (!= 2.15-0ubuntu6) but 2.15-0ubuntu7 is installed
 libc6:i386 : Breaks: libc6 (!= 2.15-0ubuntu7) but 2.15-0ubuntu6 is installed
 libc6-dev : Depends: libc6 (= 2.15-0ubuntu7) but 2.15-0ubuntu6 is installed
 libc6-i386 : Depends: libc6 (= 2.15-0ubuntu7) but 2.15-0ubuntu6 is installed
E: Unmet dependencies. Try using -f.

When trying apt-get -f install I get this:
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.15-0ubuntu7_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/libc6_2.15-0ubuntu7_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/980573/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
prodigel (prodigel) on 2012-04-13
affects: ubuntu → eglibc (Ubuntu)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in eglibc (Ubuntu):
status: New → Confirmed

This now effects one of my machines that was upgraded to Ubuntu 12.04 from 10.04 a few months ago.

I used aptitude to upgrade the kernel and libc packages released yesterday (21 Oct 2013) which failed with similar errors to above. Below is a dump of 'sudo apt-get install -f' ran afterwards:

$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  linux-image-server
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libc6 linux-headers-3.2.0-55-generic-pae linux-headers-generic-pae
The following NEW packages will be installed
  linux-headers-3.2.0-55-generic-pae
The following packages will be upgraded:
  libc6 linux-headers-generic-pae
2 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.
2 not fully installed or removed.
Need to get 0 B/4,923 kB of archives.
After this operation, 11.3 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Preconfiguring packages ...
(Reading database ...
dpkg: warning: files list file for package `libc6' missing, assuming package has no files currently installed.
(Reading database ... 437713 files and directories currently installed.)
Preparing to replace libc6 2.15-0ubuntu10.4 (using .../libc6_2.15-0ubuntu10.5_i386.deb) ...

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

dpkg: error processing /var/cache/apt/archives/libc6_2.15-0ubuntu10.5_i386.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
No apport report written because MaxReports has already been reached
                                                                    Errors were encountered while processing:
 /var/cache/apt/archives/libc6_2.15-0ubuntu10.5_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

In my report I think the key

There were not files in /var/lib/dpkg/info/ for libc6:i386, only for libc6 (ie /var/lib/dpkg/info/libc6.list existed but /var/lib/dpkg/info/libc6:i386.list did not).

I created the /var/lib/dpkg/info/libc6:i386.list file from the contents of the downloaded deb package using:

dpkg-deb -c /var/cache/apt/archives/libc6_2.15-0ubuntu10.5_i386.deb | awk {'sub(/^\./,"",$6);sub(/^\/$/,"/.",$6); sub(/\/$/,"",$6); print $6'} > /var/lib/dpkg/info/libc6:i386.list

After this 'apt-get install -f' run correctly and the libc6 package was upgraded. Then the rest of the package upgrades were done via aptitude.

The mention of libc6:i386 suggests that the problem maybe linked to multiarch, but I can not be sure. I also suggest that copying /var/lib/dpkg/info/libc6.list to /var/lib/dpkg/info/libc6:i386.list might also work temporarily.

So fixed for me for the moment.

Correction for my previous post. The first line should have read:

In my report I think the key is the line which warns that the files list file for package `libc6' is missing.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers