16

This question already has an answer here:

How to fix E: Internal Error, No file name for libc6, Like that will show If I do:

$ sudo apt-get upgrade
or
$ sudo apt-get install package 

This is example :

$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages have been kept back:
  ginn hplip hplip-data libdrm-dev libdrm-intel1 libdrm-nouveau1a
  libdrm-radeon1 libdrm2 libgrip0 libhpmud0 libkms1 libsane-hpaio
  libunity-2d-private0 libunity-core-5.0-5 linux-generic-pae
  linux-headers-generic-pae linux-image-generic-pae printer-driver-hpcups
  printer-driver-hpijs unity unity-2d-common unity-2d-panel unity-2d-shell
  unity-2d-spread unity-common unity-services
The following packages will be upgraded:
  alsa-base firefox firefox-globalmenu firefox-gnome-support firefox-locale-en
  icedtea-6-jre-cacao icedtea-6-jre-jamvm icedtea-7-jre-jamvm libdbus-glib-1-2
  libdbus-glib-1-dev libgnutls-dev libgnutls-openssl27 libgnutls26
  libgnutlsxx27 libssl-dev libssl-doc libssl1.0.0 linux-sound-base
  openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib openjdk-7-jdk
  openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib openssl sudo
27 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.
3 not fully installed or removed.
Need to get 0 B/126 MB of archives.
After this operation, 3,072 B of additional disk space will be used.
Do you want to continue [Y/n]? y
E: Internal Error, No file name for libc6

I have follow instruction from here How to resolve E: Internal Error when using apt-get remove? . Which do:

sudo apt-get update
sudo apt-get clean
sudo apt-get install -fy
sudo dpkg -i /var/cache/apt/archives/*.deb
sudo dpkg --configure -a
sudo apt-get install -fy
sudo apt-get dist-upgrade

But stuck with same error E: Internal Error, No file name for libc6 when do command sudo apt-get install -fy.

And I've been looking on google, but have not been successful until now.

Thanks.

marked as duplicate by Eliah Kagan, David Foerster, Kevin Bowen, Eric Carvalho, TheWanderer Jan 25 '17 at 0:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

16

I know this is as old thread, but I encountered this problem recently during an upgrade of 12.04 LTS. None of the solutions here fully fixed my problem. After diving into it further, I found that it had something to do with the upgrade of libc6 i386 during an upgrade:

$> dpkg -i /var/cache/apt/archives/libc6_2.15-0ubuntu10.6_i386.deb
(Reading database ... 259895 files and directories currently
installed.) Preparing to replace libc6:i386 2.15-0ubuntu10.5 (using
.../libc6_2.15-0ubuntu10.6_i386.deb) ... dpkg: error processing
/var/cache/apt/archives/libc6_2.15-0ubuntu10.6_i386.deb (--install): 
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:

After much tinkering, this seemed to work for. The goal is to remove the offensive libc6 package that fails to upgrade, and incrementally get the rest of the upgrade to work, which eventually also upgrades the libc6 package.

  1. Run the upgrade (which will fail):

    sudo apt-get upgrade

  2. Then install the files we can from the cache (will succeed for some, but fail for others):

    sudo dpkg -i /var/cache/apt/archives/*.deb

  3. Remove the offensive libc6 (do not purge). It will cause a lot of dependencies to break, don't worry we'll fix them soon.

    sudo dpkg -r --force-depends libc6:i386

  4. Reconfigure it and other packages (will mostly succeed):

    sudo dpkg --configure -a

  5. Make a bit more more progress from cache (succeed for some, fail for others):

    sudo dpkg -i /var/cache/apt/archives/*.deb

  6. Now run another upgrade which will download needed packages (will fail on install):

    sudo apt-get upgrade

If you're lucky, it might start working from here, but if not, one more round of cache installs will do it.

  1. Install again from cache (will succeed!)

    sudo dpkg -i /var/cache/apt/archives/*.deb

Now you can check that further installs/upgrades will succeed.

  • 1
    Can we make this a bash while loop? – Dan R Aug 13 '14 at 17:55
  • In my case, executing dpkg -i /var/cache/apt/archives/*.deb was enough. It encountered no errors and dpkg --configure -a exited without an error afterwards. – Michael Kremser Jun 2 '16 at 5:57
  • 3
    The dpkg -r --force-depends libc6:i386 command seems to be as dangerous as it looks - after doing so, my /bin, /usr/bin etc. directories were gone, unmounted or empty! (no important machine, an internal development server only, which can easily be setup anew). Thus, it might be wise to try the other solutions first ... – Tobias Jan 3 '17 at 17:02
12

Try this:

sudo rm -f /etc/apt/sources.list.d/*
sudo dpkg --configure -a
  • 4
    just the dpkg --configure -a worked for me – gatoatigrado Nov 9 '13 at 23:13
  • As for me - that directory only contained google chrome sources, which I don't believe was the issue. Pretty sure mine was directly related to me having previously added debian 9 sources. – XtrmJosh Jan 12 '16 at 14:01
  • I am reinstalling python3.5, and meet op's error, dpkg --configure -a get dpkg: error processing package python3.5-dev (--configure): – Mithril Feb 10 '17 at 6:40
2

The following solution worked for me to resolve this issue:

sudo rm -f /etc/apt/sources.list.d/*

sudo dpkg --configure -a
2

I tried the following which helped me to resolve the issue:

dpkg -i /var/cache/apt/archives/*.deb
dpkg --configure -a 

credit goes to poster on the forum http://ubuntuforums.org/showthread.php?t=2185185

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