top 'xterm': unknown terminal type
Asked Answered
H

3

13

I have an error when run TOP command:

>top
'xterm': unknown terminal type.

> echo $TERM
xterm

> echo $DISPLAY
DYSPLAY: Undefined variable.

> cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)

> ls /usr/share/terminfo/
1 2 3 4 5 6 7 8 9 a A b c d e E f g h i j k l L m M n N o p P q Q r s t u v w x X z


> ls /usr/share/terminfo/x/xterm
/usr/share/terminfo/x/xterm

i have that problem also with Root.

does TOP use xterm?

How can i do?

Hellish answered 10/7, 2014 at 12:33 Comment(3)
i'm using ssh via putty.exeHellish
DYSPLAY: Undefined variable ?!?Neap
DYSPLAY? you have a typo somewhere in .profile or likeFuliginous
W
16

try adding

export TERM=linux

at the end of your .bashrc files (/home/myuser/.bashrc, /root/.bashrc). The problem is that the terminal definition 'xterm' is undefined

Waver answered 3/2, 2015 at 3:13 Comment(1)
export TERM=linux -> top -> 'linux': unknown terminal type.Hellish
C
5

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.

Cartouche answered 18/4, 2016 at 7:4 Comment(1)
This was my exact problem. I ended up moving the LD_LIBRARY_PATH setup to a wrapper shell script instead of on the DockerfileVolost
G
1

Instead of top, can you please try with below arguments

top -n 2 -b

it worked for me

Gunfire answered 1/11, 2022 at 5:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.