Unix Tip: Clearing the screen
Every now and then I come across a system which, when I issue a request to clear the screen (i.e. the clear command), I get something like this instead:
oopsy# clear
ld.so.1: clear: fatal: libncurses.so.5: open failed: No such file or directory
Killed
Often, on encountering this problem, I simply growl, press enter a couple dozen times and continue working. When I'm in a particularly "fixit" mood, on the other hand, I figure I shouldn't be putting up with annoying configuration problems and decide to break my train of thought just long enough to tackle this distracting problem head-on.
So, what is going on when you get an error such as this?
First, we know it came about because I issued the "clear" command. Next, we see that the error was issued by ld.so.1 (the runtime linker). Third, we see that the linker wasn't able to open a particular shared object file; it couldn't find it. The shared object file, libncurses.so.5, as you might suspect is the curses library. Curses provides a set of functions that provide users with the ability to manipulate a terminal's display regardless of the terminal type; thus the problem arose when I attempted to clear the contents of a terminal window. The curses library contains routines to accomplish this task. When I ran into the error shown above, I figured that one of two things was true. Either the library wasn't installed on the system (maybe it had been removed) or the linker just couldn't find it. A quick scan of the system showed that the "missing" library was installed in /usr/local/lib.
oopsy# ls -l /usr/local/lib/libn*
-rwxr-xr-x 1 bin bin 247760 May 1 2001 /usr/local/lib/libncurses++.a
-rw-r--r-- 1 bin bin 453732 May 1 2001 /usr/local/lib/libncurses.a
lrwxrwxrwx 1 root root 15 May 20 2003 /usr/local/lib/libncurses.so -> libncurses.so.5
lrwxrwxrwx 1 root root 17 May 20 2003 /usr/local/lib/libncurses.so.5 -> libncurses.so.5.2
-rw-r--r-- 1 bin bin 338384 May 1 2001 /usr/local/lib/libncurses.so.5.2
-rw-r--r-- 1 bin bin 3459752 May 1 2001 /usr/local/lib/libncurses_g.a
Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @IT_world
On Twitter now
clearing the screen
Powered by Twitter
jfruh
Apple syncing patent can't come soon enough
pasmith
New Twitter features borrow from 3rd party clients
Esther Schindler
Open Source Changes the Software Acquisition Process
mikelgan
How to set up continuous podcast play on the new iTunes
David Strom
Five important Windows 7 mobility features
sjvn
Guard your Wi-Fi for your own sake
Sandra Henry-Stocker
Grepping on Whole Words
Sidekick: The Good News & the Bad News
Either way you look at it Microsoft Data Center management did not follow standards or best practices in this failure. In which case it makes me wonder more about the outsourcing of corporate data much less personal data.
- mburton325
Join the conversation here
Quick, practical advice for IT pros. Made fresh daily.
Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.













