top 'xterm': unknown terminal type
Here is another possible cause of top
terminal problems.
I had the same problem (on one particular SLES 11.3 box) - whatever I set TERM
to (default was xterm
), top would say "unknown terminal type
".
My /usr/share/terminfo
files were all fine, as was /etc/termcap
, and my ncurses library.
Then I noticed that top ran fine as another user, so it must be an environment problem.I tracked it down to LD_LIBRARY_PATH
, which was set to/opt/PostgreSQL/9.3/pgAdmin3/lib:/opt/PostgreSQL/9.3/lib:
(I have PostgreSQL installed on this box).
The problem was that PostgreSQL supplies its own libncurses.so.5
library (among many others), and top
doesn't work with it.
If I unset LD_LIBRARY_PATH
, or make PostgreSQL's library a soft link to /usr/lib/libncurses.so
, then top
works fine again.