Apt update stuck with "A copy of the C library was found in an unexpected directory"
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Apt update stuck with "A copy of the C library was found in an unexpected directory"
Hi Greetings from a Debian user from China.
I am using Debian Sid release. But unfortunately I got stuck on the "aptitude dist-upgrade" the other day but yet to fix it by now.
I googled a lot but without any luck.
Below are the 7 main steps/command I have tried over and over(but failed) and their outputs.
1, cat /etc/debian_version
Code:
wheezy/sid
2, uname -a
Code:
Linux squeeze.local 3.0.0-1-686-pae #1 SMP Sat Aug 27 16:41:03 UTC 2011 i686 GNU/Linux
3,cat /etc/apt/sources.list
Code:
deb http://ftp.debian.org/debian unstable main contrib non-free
deb-src http://ftp.debian.org/debian unstable main contrib non-free
deb http://security.debian.org/debian-security unstable main contrib non-free
#deb http://ftp.tw.debian.org/debian-multimedia/ testing main
#deb-src http://ftp.tw.debian.org/debian-multimedia/ testing main
Reading package lists...
Building dependency tree...
Reading state information...
Reading extended state information...
Initializing package states...
The following NEW packages will be installed:
fonts-ecolier-lignes-court{a} fonts-farsiweb{a} fonts-freefarsi{a}
.............(tons of package names deleted here by Exoool
The following partially installed packages will be configured:
unionfs-fuse{b}
763 packages upgraded, 46 newly installed, 8 to remove and 0 not upgraded.
Need to get 990 MB/1368 MB of archives. After unpacking 127 MB will be used.
The following packages have unmet dependencies:
python-pygoocanvas: Depends: python (< 2.7) but 2.7.2-7 is to be installed.
pymol: Depends: python (< 2.7) but 2.7.2-7 is to be installed.
python-gudev: Depends: python (< 2.7) but 2.7.2-7 is to be installed.
hplip: Depends: python (< 2.7) but 2.7.2-7 is to be installed.
libavutil-extra-51: Conflicts: libavutil51 but 5:0.8-0.2 is installed.
python-gtkmozembed: Depends: python (< 2.7) but 2.7.2-7 is to be installed.
python-uno: Depends: python (< 2.7) but 2.7.2-7 is to be installed.
pulseaudio-module-hal: Depends: libpulse0 (= 0.9.23-1) but 1.0-2 is to be installed.
unionfs-fuse: Depends: fuse-utils but it is not going to be installed.
lilypond: Depends: python (< 2.7) but 2.7.2-7 is to be installed.
libpulse-browse0: Depends: libpulse0 (= 0.9.23-1) but 1.0-2 is to be installed.
deskbar-applet: Depends: python (< 2.7) but 2.7.2-7 is to be installed.
The following actions will resolve these dependencies:
Remove the following packages:
1) deskbar-applet
2) gnome-desktop-environment
3) hplip
4) libavutil51
5) libpostproc51
6) libpulse-browse0
7) libreoffice-emailmerge
8) lilypond
9) pitivi
10) pulseaudio-module-hal
11) pymol
12) python-gtkmozembed
13) python-gudev
14) python-pygoocanvas
15) python-uno
16) unionfs-fuse
Leave the following dependencies unresolved:
17) education-chemistry recommends pymol
18) education-common recommends hplip
19) education-desktop-gnome recommends gnome-desktop-environment
20) denemo recommends lilypond
21) exaile recommends python-gtkmozembed
22) gnome-applets recommends deskbar-applet
23) libsane-hpaio recommends hplip (= 3.11.7-1)
24) libreoffice-writer recommends libreoffice-emailmerge
25) lilypond-data recommends lilypond (>= 2.12.3-7)
26) rosegarden recommends lilypond
Accept this solution? [Y/n/q/?] The following NEW packages will be installed:
fonts-ecolier-lignes-court{a} fonts-farsiweb{a} fonts-freefarsi{a}
.............(tons of package names deleted here by Exoool
ntrack-module-libnl-0{a} python2.7{a} python2.7-dbg{a}
python2.7-minimal{a} rtkit{a} xulrunner-7.0{a}
The following packages will be REMOVED:
deskbar-applet{a} frei0r-plugins{u} gnome-desktop-environment{a}
.............(many package names deleted here by Exoool
python-uno{a} unionfs-fuse{a}
The following packages will be upgraded:
alsa-utils amarok-utils
.............(tons of package names deleted here by Exoool
xserver-xorg-video-voodoo xul-ext-firebug xutils yelp
754 packages upgraded, 46 newly installed, 32 to remove and 0 not upgraded.
Need to get 989 MB/1350 MB of archives. After unpacking 60.8 MB will be used.
Do you want to continue? [Y/n/?] Writing extended state information...
Get:1 http://dl.google.com/linux/musicmanager/deb/ stable/main google-musicmanager-beta i386 1.0.18.6104-r0 [2992 kB]
....................
Get:388 http://ftp.debian.org/debian/ unstable/main subversion-tools all 1.6.17dfsg-2 [224 kB]
Reading changelogs...
apt-listchanges: Mailing root: apt-listchanges: news for squeeze.local
Extracting templates from packages: 3%
.........
Extracting templates from packages: 97%
Extracting templates from packages: 100%
Preconfiguring packages ...
Fetched 989 MB in 47min 34s (347 kB/s)
(Reading database ...
dpkg: warning: files list file for package `gnome-power-manager' missing, assuming package has no files currently installed.dpkg: warning: files list file for package `gedit' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `locales-all' missing, assuming package has no files currently installed.
............................Thousand lines of similar code deleted by Exoool
dpkg: warning: files list file for package `cairo-dock-toons-plugin' missing, assuming package has no files currently installed.
......
(Reading database ... 100%
(Reading database ... 1366 files and directories currently installed.)
Removing unionfs-fuse ...
Removing gnome-desktop-environment ...
Removing deskbar-applet ...
Removing frei0r-plugins ...
Removing gnome-games-extra-data ...
Removing pitivi ...
Removing gstreamer0.10-gnonlin ...
Removing hplip ...
Removing hplip-data ...
Processing triggers for man-db ...
dpkg: warning: parsing file '/var/lib/dpkg/available' near line 21157 package 'linuxqq':
error in Version string 'v1.0.2-beta1': version number does not start with digit
dpkg: warning: parsing file '/var/lib/dpkg/available' near line 39476 package 'svbuilderpro':
error in Version string 'v2.1.2': version number does not start with digit
(Reading database ...
dpkg: warning: files list file for package `gnome-power-manager' missing, assuming package has no files currently installed.
............................Thousand lines of similar code deleted by Exoool
dpkg: warning: files list file for package `cairo-dock-toons-plugin' missing, assuming package has no files currently installed.
(Reading database ... 100%
(Reading database ... 1362 files and directories currently installed.)
Preparing to replace libc6 2.13-16 (using .../libc6_2.13-21_i386.deb) ...
A copy of the C library was found in an unexpected directory:
'/lib/i386-linux-gnu/libc-2.13.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.13-21_i386.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
configured to not write apport reports
Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.13-21_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Reading package lists...
Building dependency tree...
Reading state information...
Reading extended state information...
Initializing package states...
Writing extended state information...
6, Step 5 failed with a dpkg error, so I tried "aptitude -f install" and hope it can erase that error. Below are the output:
Code:
Reading package lists...
Building dependency tree...
Reading state information...
Reading extended state information...
Initializing package states...
Writing extended state information...
The following NEW packages will be installed:
fonts-ecolier-lignes-court{a} fonts-farsiweb{a} fonts-freefarsi{a}
.............(tons of package names deleted here by Exoool
python2.7-minimal{a} rtkit{a} xulrunner-6.0 xulrunner-7.0{a}
The following packages will be REMOVED:
gnome-accessibility{u} hamster-applet{u} libavutil51{a} libcv2.1{u}
libcvaux2.1{u} libdbus-c++-1-0{u} libgavl1{u} libgnome2-canvas-perl{u}
libgnome2-perl{u} libgnome2-vfs-perl{u} libhighgui2.1{u}
libimobiledevice1{u} libnm-glib2{u} libnm-util1{u}
libpanelappletmm-2.6-1c2{u} libpostproc51{a} libpulse-browse0{a}
libreoffice-emailmerge{a} libsane-hpaio{u} libwebkit-1.0-2{u}
libwebkit-1.0-common{u} lilypond{a} mousetweaks{u}
pulseaudio-module-hal{a} pymol{a} python-evolution{u}
python-gnomedesktop{u} python-gtkmozembed{a} python-gudev{a}
python-imaging{u} python-pexpect{u} python-pygoocanvas{a} python-uno{a}
python-wnck{u} xdg-user-dirs-gtk{u}
The following packages will be upgraded:
alsa-utils amarok-utils amoeba-data ant ant-optional apache2 apache2-doc
.............(tons of package names deleted here by Exoool
xserver-xorg-video-voodoo xul-ext-firebug xutils yelp
754 packages upgraded, 49 newly installed, 35 to remove and 0 not upgraded.
Need to get 39.6 kB/1362 MB of archives. After unpacking 108 MB will be used.
Do you want to continue? [Y/n/?] Writing extended state information...
Get:1 http://ftp.debian.org/debian/ unstable/main fuse-utils all 2.8.6-1 [39.6 kB]
Reading changelogs...
Extracting templates from packages: 3%
..............
Extracting templates from packages: 100%
Preconfiguring packages ...
Fetched 39.6 kB in 2s (19.3 kB/s)
(Reading database ...
dpkg: warning: files list file for package `libwine-gphoto2' missing, assuming package has no files currently installed.
............................Thousand lines of similar code deleted by Exoool
dpkg: warning: files list file for package `locales-all' missing, assuming package has no files currently installed.
................
(Reading database ... 100%
(Reading database ... 1362 files and directories currently installed.)
Preparing to replace libc6 2.13-16 (using .../libc6_2.13-21_i386.deb) ...
A copy of the C library was found in an unexpected directory:
'/lib/i386-linux-gnu/libc-2.13.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.13-21_i386.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
configured to not write apport reports
Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.13-21_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Reading package lists...
Building dependency tree...
Reading state information...
Reading extended state information...
Initializing package states...
Writing extended state information...
7, So you can see that it's the same error happened in setep 5 showing again. As it's an error about "/var/cache/apt/archives/libc6_2.13-21_i386.deb", I tried to install it individually by command "dpkg -i /var/cache/apt/archives/libc6_2.13-21_i386.deb", and below are the output of that command:
Code:
dpkg: warning: files list file for package `gnome-power-manager' missing, assuming package has no files currently installed.
............................Thousand lines of similar code deleted by Exoool
dpkg: warning: files list file for package `libfftw3-3' missing, assuming package has no files currently installed.
1362 files and directories currently installed.)
Preparing to replace libc6 2.13-16 (using .../libc6_2.13-21_i386.deb) ...
A copy of the C library was found in an unexpected directory:
'/lib/i386-linux-gnu/libc-2.13.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.13-21_i386.deb (--install):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.13-21_i386.deb
Still the same error msg, still no luck :(
I know there are tons of warning msg(and I have deleted most of them because the character limit in a post) like "dpkg: warning: files list file for package `locales-all' missing, assuming package has no files currently installed.", but I do *not* think they the root of this problem. Instead I think the problem here is all about
Quote:
A copy of the C library was found in an unexpected directory:
'/lib/i386-linux-gnu/libc-2.13.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.
But unfortunately I do not have the UNIONFS installed, and I just can not install anything now if I can not get over this error!
2, Another similar situation to mine is this one: http://shearer.org/Debugging_Dpkg_Problems
The author fixed his problem by following the hint of "Matching libraries: /usr/lib/libpthread.so.20 /lib/ld-linux.so.2", which however is not shown in my case and my issue here seems have nothing to with the "libpthread", so it didn't help either.
I am kind of newbie on aptitude/dpkg who generally hoping aptitude -f install can always do the trick when trouble come up. So I really run out my solutions now.
Please anyone can help come to post your opinions/instructions, if you need any other info about my system, let me know. Though I have dual system and can use my Windows XP system for now, I really am missing the days using Debian though it sometimes give me troubles. I solved all of them but failed this one:(
It's 5 in the morning, so I got to sleep for a while now, thanks in advance for any interest and help!
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628
Rep:
Why on earth did you let it remove most of your system? That is why they list all those packages to be removed.
Read them, think about them, if in doubt don't do it.
You could probably repair this, given time and effort. Reinstalling would be easier and faster.
If you are installed on two partitions (/ and /home) this is easy. Just do a manual install and don't format /home and you should be OK.
If you are on one partition, back up your data and reinstall on two clean partitions.
If you are using Sid you will have a lot better time if you have all your repos from Sid. If you want testing stick with testing repos.
I do not do that on some of my installs but I do on the ones I want to have work reliably.
If you reinstall right now I would stick with Testing as there is a problem with xorg and xserver-xorg-common right now (or was yesterday - haven't checked today). Had to down grade my Sid installs to Testing packages of those to have it work.
Why on earth did you let it remove most of your system? That is why they list all those packages to be removed.
Read them, think about them, if in doubt don't do it.
You could probably repair this, given time and effort. Reinstalling would be easier and faster.
If you are installed on two partitions (/ and /home) this is easy. Just do a manual install and don't format /home and you should be OK.
If you are on one partition, back up your data and reinstall on two clean partitions.
If you are using Sid you will have a lot better time if you have all your repos from Sid. If you want testing stick with testing repos.
I do not do that on some of my installs but I do on the ones I want to have work reliably.
If you reinstall right now I would stick with Testing as there is a problem with xorg and xserver-xorg-common right now (or was yesterday - haven't checked today). Had to down grade my Sid installs to Testing packages of those to have it work.
Thanks, Widget!
I didn't even notice that aptitude was trying to remove the most of my system!
I thought it's just another normal "aptitude update && aptitude dist-upgrade", so simply answered "y" to each questions without looking at the detail of them.
But yes, I am in doubt and and no idea why that happened either. I think I will just keep this question in mind when I try to fix it in future.
As for a re-installation, even I think I know how to backup data and re-install the system if I have to, I want to anyhow take it as my last choice for two reasons:
First, it will be kind of trouble cause I have all file in one sole partition, not only /home, but also for /var and /srv, where most of my website applications sit in. So if it takes similar time to re-install and fix, I'd rather fix it.
The second reason, I want to learn and gain experience on how to fix issues like this as I want to live with Debian Testing for a long long time in future. I have been using Debian stable for 1 year, and I think it's time to play with sid toys.
So it's good to know that
Quote:
You could probably repair this, given time and effort.
I tend to avoid using dist-upgrade and stick to safe-upgrade for regular upgrades. Also I don't know how often you upgrade your system but it is unusual, to say the least, to have over 700 packages to upgrade. Also if you have exclusively sid repos in your sources.list why does /etc/debian_version report your release as "wheezy/sid"?
You are repeatedly instructed to remove lib/i386-linux-gnu/libc-2.13.so. Do you do this? If not, why not?
ciao,
jdk
I tend to avoid using dist-upgrade and stick to safe-upgrade for regular upgrades. Also I don't know how often you upgrade your system but it is unusual, to say the least, to have over 700 packages to upgrade. Also if you have exclusively sid repos in your sources.list why does /etc/debian_version report your release as "wheezy/sid"?
You are repeatedly instructed to remove lib/i386-linux-gnu/libc-2.13.so. Do you do this? If not, why not?
ciao,
jdk
I actually tried to move the "/lib/i386-linux-gnu/libc-2.13.so" out of "/lib/i386-linux-gnu/" directory. But it leads to a worse situation, where I just can not issue any command even simple ones like "ls", "cat". It seemed that the libc-2.13.so is in the core stage of system. So later I had to boot into a live-cd and manually moved "/lib/i386-linux-gnu/libc-2.13.so" back to its original dir so that I can at least execute "normal" command.
For the dist-upgrade, for the previous system update before my last update which messed it up, I updated it by the Synaptic manager. Just I chose to "remove packages", which I think made it "unsafe" and lead to the dpkg error.
I usually update my system daily, but I now can not remember how many days was it between my last two updates. It could be several days. But I guess because the sid release update more frequently than other releases, maybe it's possible to accumulate that many updates in several days.
For the question Also if you have exclusively sid repos in your sources.list, why does '/etc/debian_version' report your release as "wheezy/sid"?
Sorry but I do not quite understand. Because i thought 'wheezy/sid' shall be the right response when the resources list are pointing to the sid repos?
Thanks for the clear answer, exoool. Yes, I'm sure there's more activity in Sid than in Wheezy. I run Testing myself with some pinning to Sid and my system comes out as wheezy/sid. I would have thought that an exclusively Sid system would come out as "sid" instead of "wheezy/sid" but maybe I'm wrong.
ciao,
jdk
and my sources.list that was originally for Squeeze. I have xserver pinned to a version that was in testing but now i in backports.
I always do ' aptitude upgrade -s ' first so I can play with the ' n ' option to look for the best solution and never use full-upgrade or dist-upgrade. Synaptic is okay for Squeeze but should never be used with Sid. If you read the Aptosid forums you will find that they want you to ctrl+ alt+ F1 then stop gdm3 then upgrade. That's a bit much if you ask me but I do use the command line exclusively.
Read ' man dpkg-reconfigure ' and ' man aptitude '
I always do ' aptitude upgrade -s ' first so I can play with the ' n ' option to look for the best solution and never use full-upgrade or dist-upgrade. Synaptic is okay for Squeeze but should never be used with Sid. If you read the Aptosid forums you will find that they want you to ctrl+ alt+ F1 then stop gdm3 then upgrade. That's a bit much if you ask me but I do use the command line exclusively.
Read ' man dpkg-reconfigure ' and ' man aptitude '
By the way, exool, I see you are from Guangzhou. I just wanted to let you know I spent 2 years at Guangwai working as a "Specially appointed professor" there.
再见
jdk
By the way, exool, I see you are from Guangzhou. I just wanted to let you know I spent 2 years at Guangwai working as a "Specially appointed professor" there.
再见
jdk
LOL, 你好,Jdk
Very nice to know that!
It's such a "small" world, isn't it? Maybe we have a chance to meet next time you visit GuangZhou so we can talk more about Debian
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.