package libc6-dev-i386 (not installed) failed to install/upgrade: trying to overwrite '/usr/include/gnu', which is also in package libc6-dev-amd64 2.19-0ubuntu6.3

Bug #1365375 reported by richud
96
This bug affects 20 people
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

apt-get install gcc-multilib broke it!

ProblemType: Package
DistroRelease: Ubuntu 14.04
Package: libc6-dev-i386 (not installed)
ProcVersionSignature: Ubuntu 3.13.0-35.62-generic 3.13.11.6
Uname: Linux 3.13.0-35-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.1-0ubuntu3.3
Architecture: amd64
Date: Thu Sep 4 08:50:46 2014
DpkgTerminalLog:
 Preparing to unpack .../libc6-dev-i386_2.19-0ubuntu6.3_amd64.deb ...
 Unpacking libc6-dev-i386 (2.19-0ubuntu6.3) ...
 dpkg: error processing archive /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.3_amd64.deb (--unpack):
  trying to overwrite '/usr/include/gnu', which is also in package libc6-dev-amd64 2.19-0ubuntu6.3
DuplicateSignature: package:libc6-dev-i386:(not installed):trying to overwrite '/usr/include/gnu', which is also in package libc6-dev-amd64 2.19-0ubuntu6.3
ErrorMessage: trying to overwrite '/usr/include/gnu', which is also in package libc6-dev-amd64 2.19-0ubuntu6.3
SourcePackage: eglibc
Title: package libc6-dev-i386 (not installed) failed to install/upgrade: trying to overwrite '/usr/include/gnu', which is also in package libc6-dev-amd64 2.19-0ubuntu6.3
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
richud (richud.com) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in eglibc (Ubuntu):
status: New → Confirmed
Revision history for this message
Ben Johnson (a03-6eo-chg) wrote :

Thanks for taking the time to report this, richud, and especially for providing the attachments.

This bug bit me today, too.

Were you able to implement any sort of a workaround?

This seems like a significant problem to go unfixed since September, 2014.

Here's what happened, in my particular case (impetus was to compile NGINX):

# apt-get install libpcre3-dev zlib1g-dev libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
zlib1g-dev is already the newest version.
zlib1g-dev set to manually installed.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 gcc-4.8-multilib : Depends: libc6-dev-i386 (>= 2.11) but it is not going to be installed
 lib32z1-dev : Depends: lib32c-dev
 libc6-dev-x32 : Depends: libc6-dev-i386 (= 2.19-0ubuntu6.5) but it is not going to be installed
 libpcre3-dev : Depends: libpcrecpp0 (= 1:8.31-2ubuntu2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Okay, so I try "apt-get install -f"...

# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libc6-dev-i386
The following NEW packages will be installed:
  libc6-dev-i386
0 upgraded, 1 newly installed, 0 to remove and 15 not upgraded.
22 not fully installed or removed.
Need to get 0 B/1,151 kB of archives.
After this operation, 6,337 kB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 137387 files and directories currently installed.)
Preparing to unpack .../libc6-dev-i386_2.19-0ubuntu6.5_amd64.deb ...
Unpacking libc6-dev-i386 (2.19-0ubuntu6.5) ...
dpkg: error processing archive /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.5_amd64.deb (--unpack):
 trying to overwrite '/usr/include/gnu', which is also in package libc6-dev-amd64 2.19-0ubuntu6.5
Errors were encountered while processing:
 /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.5_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

It's a bit difficult to compile anything on this system, without access to these crucial libraries.

Worse, aptitude is now "stuck" in this state, and complains any time I try to modify a package (even unrelated packages). Here's an example:

# apt-get autoremove
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:
 gcc-4.8-multilib : Depends: libc6-dev-i386 (>= 2.11) but it is not installed
 lib32z1-dev : Depends: lib32c-dev
 libc6-dev-x32 : Depends: libc6-dev-i386 (= 2.19-0ubuntu6.5) but it is not installed
E: Unmet dependencies. Try using -f.

Of course, "apt-get install -f" just vomits the same error that I pasted above.

So, I'm stuck in a loop with no way out.

Suggestions, anyone?

Revision history for this message
Ben Johnson (a03-6eo-chg) wrote :

To follow-up on my previous comment, I was able to work around this "broken state" in aptitude by purging the offending packages with "--force-depends":

dpkg --purge --force-depends "gcc-multilib"
dpkg --purge --force-depends "lib32z1-dev"
dpkg --purge --force-depends "libc6-dev-x32"

Now, I'm able to use "apt-get" as normal.

Hopefully, this workaround won't cause problems in the future.

description: updated
Revision history for this message
Karthik KR (krishnapuram) wrote :

Tried your work around

The last command "dpkg --purge --force-depends "libc6-dev-x32"did help in resolving the issue.
Very irritating to see that one apt-get install breaks your entire system.

Got into this issue because I was trying to initialize an Android build environment on 14.04/64 bit.
The AOSP advises to install g++multilib which simply breaks the system.
I was not even able to install or remove any package when it was broken.

Revision history for this message
Ben Johnson (a03-6eo-chg) wrote :

@Karthik

I agree; this is a particularly severe bug because it renders the entire apt-get facility useless.

For what it's worth, even though the last command is the command that "fixes" the issue, I believe it to be desirable to execute the previous two commands, too, because those packages are part of the problematic dependency-chain.

In other words, even though it may be possible to remove only the "libc6-dev-x32" package and "fix" the problem, that approach seems more likely to introduce problems in the future (i.e., once Canonical fixes this package).

Revision history for this message
DougL (dlarue) wrote :

It bit me trying to get an ARM cross compiler setup going. Kinda scary when your package manager goes wonky and it starts looking like there's no way out. Thanks to lots of things like this(see below) there was a way out:
sudo dpkg --purge --force-depends "gcc-multilib"
sudo dpkg --purge --force-depends "lib32z1-dev"
sudo dpkg --purge --force-depends "libc6-dev-x32"

Revision history for this message
Ben Johnson (a03-6eo-chg) wrote :

This bit me yet again, and this time, I had to add one more package to the list (lib64z1-dev, which is simply the x64 equivalent of lib32z1-dev, which we already knew to be problematic). The complete list of packages to force-remove to resolve this is now:

sudo dpkg --purge --force-depends "gcc-multilib"
sudo dpkg --purge --force-depends "libc6-dev-x32"
sudo dpkg --purge --force-depends "lib32z1-dev"
sudo dpkg --purge --force-depends "lib64z1-dev"

This package deadlock becomes a problem for anyone who attempts to compile software that includes gzip (e.g., nginx, opentracker). Given gzip's relative popularity, this should really be fixed.

Revision history for this message
Jerry (chan-th-jerry) wrote :

I tried this, and got apt-get running back successfully.

sudo apt-get remove libc6-amd64:i386 libc6-dev-amd64:i386

( credit to : Sneetsher )
http://askubuntu.com/questions/701065/how-to-recover-from-an-apt-get-problem

Revision history for this message
Duncan Thomas (duncan-thomas) wrote :

Still an issue - I ran into it trying to install android studio today on 15.10

Revision history for this message
Max HOHENGARTEN (mazette24) wrote :

I'm having this bug not solved, it happened to me when I tried to install steam on 16.04.
The dpkg commands mentionned by #7 and #8 worked, but didn't solve the problem for me.

I also tried doing sudo apt-get remove libc6-amd64:i386 libc6-dev-amd64:i386, but my apt-get is still broken because of gcc-multilib, so it refuses to do anything.

Revision history for this message
Hardiksingh Rathore (hardiksingh-rathore) wrote :

Try this

sudo aptitude install libc6-dev:i386

Revision history for this message
aratic (araticsu) wrote :

Hardiksingh Rathore (hardiksingh-rathore) 's answer do solves my problem

i met such problem by accidentally requires libstdc++6:i386, after install it, maybe i messed up the multilib setting.

Thanks a lot.

Revision history for this message
Hardiksingh Rathore (hardiksingh-rathore) wrote :

If above answer is not working then
Try this
dpkg --remove libc6-amd64:i386 libc6-dev-amd64:i386

Revision history for this message
Ben Johnson (a03-6eo-chg) wrote :

The fact that this was reported on 2014-09-04 and *still* has not been fixed is unbelievable.

It seems related to (or the same as) https://bugs.launchpad.net/ubuntu/+source/zlib/+bug/1512992 , which was opened on 2015-11-04 and has not been fixed yet either.

Only ten days ago was a fix proposed, which, by the way, doesn't seem to resolve the problem. That is to say nothing of the obsoleted instructions at https://wiki.ubuntu.com/Testing/EnableProposed , which still mention the "aptitude" executable, which doesn't even exist in Ubuntu 16.

Pretty disappointing, all around.

Revision history for this message
Charles McColm (chaslinux) wrote :

I second Ben's comment, we're almost 3 years on with a severe bug and it's still in Ubuntu 16.04.

Revision history for this message
John Orben (jinxius) wrote :

Wow, this issue is a real pain. It took me a couple of hours hacking around to find this page and finally remove the offending packages.

Revision history for this message
Fernando (fernandoalo) wrote :

I have the same issue. I corrected this problem removing first the "libx32ncurses5-dev" package, then the others. I hope so this be useful.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.