Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my Ubuntu 11.10, I am running a version of gdb for different target other than host machine and I am getting the following error:

xxxxx-none-linux-gnu-gdb: error while loading shared libraries: /usr/lib/ file too short

Following is the list of my libncurses and libtermcap on my host:

$ ls -l /usr/lib/libtermcap.*
lrwxrwxrwx 1 root root 12 2011-09-17 00:59 /usr/lib/libtermcap.a -> libncurses.a
lrwxrwxrwx 1 root root 13 2011-09-17 00:59 /usr/lib/ ->
lrwxrwxrwx 1 root root 22 2011-12-05 17:32 /usr/lib/ -> /usr/lib/

$ ls -l /usr/lib/libncurses* 
-rw-r--r-- 1 root root 221876 2011-09-17 00:59 /usr/lib/libncurses.a
-rw-r--r-- 1 root root 113216 2011-09-17 00:59 /usr/lib/libncurses++.a
-rw-r--r-- 1 root root     31 2011-09-17 00:59 /usr/lib/

$ cat /usr/lib/ 
INPUT( -ltinfo)

$ uname -a
Linux hostname 3.0.0-13-generic-pae #22-Ubuntu SMP Wed Nov 2 15:17:35 UTC 2011 i686 i686 i386 GNU/Linux

How to get over this issue ?

share|improve this question
After resolving this issue as per Pere's suggestion, I got a similar issue with Had to do the following: ln -s /lib/i386-linux-gnu/ /lib/ – Sukanto Feb 1 '12 at 13:23
up vote 0 down vote accepted

The libncruses library is actually in /lib/

Just make a symlink to /lib/ (or the right version, /lib/ in my system) into /usr/lib/ and it will work.

share|improve this answer
Thanks Pere it worked :) – Sukanto Feb 1 '12 at 13:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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