LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   apt-get messed up (http://www.linuxquestions.org/questions/linux-newbie-8/apt-get-messed-up-812346/)

marguelles 06-05-2010 01:41 PM

apt-get messed up
 
Hi guys,

I am currently switching from Windows to GNU/Linux. The bad habit of throw libs into system32 folder made me break the apt-get command.

I copied a library from my DEBIAN Lenny 32bit to my DEBIAN Lenny 64bit.

Code:

# scp root@DEBIAN:/usr/lib/libstdc++.so.6 .
After that, I got the error bellow when running apt-get install ...

Code:

apt-get: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS32
Could anyone help me with this?

I googled this but all the information is out of date or is wrong. However, too many people asked to run this commands. Hope will be useful for you:

Code:

# file /usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6: symbolic link to `libstdc++.so.6.0.10'

# file /usr/lib/libstdc++.so.6.0.10
/usr/lib/libstdc++.so.6.0.10: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped


Thanks in advance.

btmiller 06-05-2010 03:45 PM

Looks like you learned an important lesson about not messing around with important system files. Anyhow, /usr/lib/libstdc++.so.6 is in the libstdc++6 package. I'd suggest that you locate the .deb file for libstdc++6 on your install media, purge the old package from your system, and simply reinstall it with "dpkg -i" (you might need to add the --force-all option to dpkg). The procedure is roughly described in this article, however as your apt-get is broken you'll need to do everything with dpkg directly instead of using apt-get. Alternatively, you might try just extracting the libstdc++.so.6.0.10 file from the .deb file and copying it over the bad 32 bit version (instructions for extracting files from .deb packages may be found here.

Good luck and in the future please think twice before messing with critical system libraries (at least it wasn't glibc that you overwrote ;-)).

marguelles 06-05-2010 04:50 PM

It was a netinstall. I've just replaced the file like you said and it's working again :)

Thanks man!

kamjad 11-24-2011 09:36 AM

Quote:

Originally Posted by marguelles (Post 3993713)
It was a netinstall. I've just replaced the file like you said and it's working again :)

Thanks man!

hiya

i am facing the same problem, apt-get and synaptic package manager is not responding , could you please describe me what did you do in details, my knowledge is just scratch, so i need little steps to be known, i am using ubuntu 10.04. when i type in root apt-get then i see the following message
apt-get: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS64

also in my case all icons on desktop are disappeared, how ever i can see the desktop items in shell,

many thanks in advance


All times are GMT -5. The time now is 07:02 PM.