Google+ Followers

2013年3月15日 星期五

gdb: error while loading shared libraries: cannot open shared object file: No such file or directory @ Ubuntu 12.04 Server 64Bit

原先以為安裝 libexpat1-dev 後即可解決,但有更多細節該留意,就順手記一下吧

$ sudo find / -name "*"
$ sudo ln -s /lib/x86_64-linux-gnu/ /lib/i386-linux-gnu/
$ sudo ldconfig
$ gdb
gdb: error while loading shared libraries: wrong ELF class: ELFCLASS64
$ sudo apt-get install ia32-libs
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
ia32-libs : Depends: ia32-libs-multiarch
E: Unable to correct problems, you have held broken packages.
$ dpkg --print-architecture
$ dpkg --print-foreign-architectures
$ sudo unlink /lib/i386-linux-gnu/
$ sudo apt-get install libexpat1-dev:i386
$ sudo ln -s /lib/i386-linux-gnu/ /lib/i386-linux-gnu/
$ gdb