LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-10-2014, 07:17 AM   #1
inyourmind
LQ Newbie
 
Registered: Jul 2014
Posts: 4

Rep: Reputation: Disabled
top 'xterm': unknown terminal type.


Hello mates,

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.


do TOP use xterm?

How can i do?
 
Old 07-10-2014, 10:19 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Command line applications rely on your TERM variable to determine how to display information your screen. Since top has to show information on you screen (in a text) interface it needs to use the TERM you defined.

xterm is the default for many things and is based on the old vt100 definition.

On my RHEL6.x boxes top runs fine using xterm.

This suggests perhaps there is an issue with the xterm you have or the top you have.

Run "rpm -qf /usr/share/terminfo/x/xterm" to determine which package installed that.
Run "yum list <package>" on the name of the package without version, architecture to see if there are newer versions available.
e.g. if the first command output something like: ncurses-base-5.7-3.20090208.el6.x86_64 then run "yum list "ncurses-base".
That should show which version you have installed and if any later versions are available. If there are later versions you can update by running "yum update <package>" to see if it gives you a better xterm.

Similarly you could check the same for top.

By the way when doing "ls" you might want to get in the habit of doing "ls -l" instead as it gives you much more information about the file. (e.g. if it a link when it shouldn't be).
 
Old 07-10-2014, 10:24 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Seeing that this is a RHEL system and the DISPLAY variable is not set I assume that this system is not running a GUI. Since Xterm is a GUI program it is not really a surprise that top can't handle it when no GUI is running. Set your TERM variable to linux and try it again.
 
Old 07-10-2014, 11:52 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by TobiSGD View Post
Seeing that this is a RHEL system and the DISPLAY variable is not set I assume that this system is not running a GUI. Since Xterm is a GUI program it is not really a surprise that top can't handle it when no GUI is running. Set your TERM variable to linux and try it again.
That's not correct.

You're confusing the X application named "xterm" with the Terminal definition of the same name. One does NOT need to be running X nor have the DISPLAY variable set to use the "TERM" variable "xterm" which is specifying the terminal definition rather than the X application. For example all of my PuTTY sessions use "xterm" by default. The "xterm" terminal definition is just a modified version of the old vt100 definition optimized to run INSIDE the xterm X application but other applications are quite happy using that xterm definition as well.
 
1 members found this post helpful.
Old 07-10-2014, 11:57 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by MensaWater View Post
That's not correct.

You're confusing the X application named "xterm" with the Terminal definition of the same name. One does NOT need to be running X nor have the DISPLAY variable set to use the "TERM" variable "xterm" which is specifying the terminal definition rather than the X application. For example all of my PuTTY sessions use "xterm" by default. The "xterm" terminal definition is just a modified version of the old vt100 definition optimized to run INSIDE the xterm X application but other applications are quite happy using that xterm definition as well.
Thanks for the correction.
 
Old 07-10-2014, 02:44 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
One possibility is that xterm (or the other GUI terminal emulations) is not installed.

Second,Red Hat Enterprise Linux Server release 6.3 (Santiago) may not even have a GUI installed (which can also require the XTERM terminal definitions to be installed).

Third - if no GUI is installed, then the terminal connection must be using the basic one.

Which happens to be name "linux" for the console. This is NOT an xterm. This also means that the user has the TERM environment variable defined in their profile/.login/.bashrc/... somewhere. This should never be done.

As a point, xterm is an extended ANSI terminal escape specification - it isn't VT100. A VT100 did have a number of escape sequences in common with an ANSI terminal - but only about half. The other half did things like setting scrolling regions, double width and/or double height characters, blinking (I think), and inverse video... As I recall, ANSI did not have color capability - xterm does.

Top uses the ncurses library which uses the terminfo database for terminal information (or termcap if so configured at compile time). This is a portable and reconfigurable set, but it requires the database to contain the definitions. Since the error is "'xterm': unknown terminal type." that means the definition of an xterm is not in the database.

Removing the definition of the environment variable TERM from the profile will allow the system to use the name it has been configured to use (most likely the value is supposed to be "linux").
 
Old 07-11-2014, 09:06 AM   #7
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by jpollard View Post
One possibility is that xterm (or the other GUI terminal emulations) is not installed.
Apparently you didn't read the rest of the thread. You do NOT need a GUI to run "xterm" terminal type. You do need it to run the "xterm" X application which is NOT what the OP is doing.
 
Old 07-11-2014, 11:20 AM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by MensaWater View Post
Apparently you didn't read the rest of the thread. You do NOT need a GUI to run "xterm" terminal type. You do need it to run the "xterm" X application which is NOT what the OP is doing.
Reread my answer. You don't need the GUI... but you do need the termcap/terminfo entry - and that isn't installed by default UNLESS you install the GUI. And even if you do install the termcap/terminfo entry it still won't work properly UNLESS you are running an xterm (or compatible) somewhere (such as via ssh).

A TERM environment variable set to "xterm" will not work properly from the console. Not all escape sequences are recognized by the VT console for instance.

Last edited by jpollard; 07-11-2014 at 11:21 AM.
 
Old 07-11-2014, 01:06 PM   #9
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
The OP posted originally that he DOES have the xterm terminfo file as shown by his ls output.

It is NOT correct to say it ONLY works with "GUI" tools such as Xterm.

It is also NOT correct to say it only installs with GUI/X. It is part of the ncurses package that installs multiple terminfo files.

As I noted in a prior post it works in PuTTY and various other terminal emulators as well. Specifically top DOES work with xterm in PuTTY even though neither top NOR PuTTY are X applications.

It IS correct to say that different terminfo files have different capabilities however his issue wasn't one of capability but rather that it was telling him it didn't recognize his TERM at all (i.e. couldn't find it not that it didn't work properly). My initial response to him was talking about additional information he needs to look at because as noted above it DOES work on my systems.

Last edited by MensaWater; 07-11-2014 at 01:07 PM.
 
Old 07-11-2014, 09:08 PM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by MensaWater View Post
The OP posted originally that he DOES have the xterm terminfo file as shown by his ls output.
Simple answer:

'xterm': unknown terminal type.

Thus it is not known.
Quote:

It is NOT correct to say it ONLY works with "GUI" tools such as Xterm.

It is also NOT correct to say it only installs with GUI/X. It is part of the ncurses package that installs multiple terminfo files.
Depends on the install. I have seen systems that don't have it because it isn't supported.

The fact that the error says "unknown terminal type" says it isn't installed.
Quote:
As I noted in a prior post it works in PuTTY and various other terminal emulators as well. Specifically top DOES work with xterm in PuTTY even though neither top NOR PuTTY are X applications.
It works only where the escape sequences are interpreted.
Quote:
It IS correct to say that different terminfo files have different capabilities however his issue wasn't one of capability but rather that it was telling him it didn't recognize his TERM at all (i.e. couldn't find it not that it didn't work properly). My initial response to him was talking about additional information he needs to look at because as noted above it DOES work on my systems.
Works on mine too. It doesn't work where the escape sequences are not interpreted though.
 
Old 07-14-2014, 10:15 AM   #11
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by jpollard View Post
meaningless drivel
Some people can admit when they make a mistake. Others simply continue posting to try to show they didn't.

The answer is NOT just a "simple" it isn't there. The OP posted that it is there as shown by ls so my original response was trying to get more information.

Since you'll now post more meaningless drivel I'll let you have the last word.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron tab error: No entry for terminal type "unknown"; sing dumb terminal settings. shlomi.s Linux - Software 12 09-06-2011 09:20 AM
Error opening terminal: xterm Terminal type "xterm" unknown Pscylo Slackware 10 04-17-2009 06:33 AM
linux: Unknown terminal type when doing vi packets Solaris / OpenSolaris 4 11-12-2007 11:08 PM
'xterm': unknow terminal type longnam Slackware 2 08-27-2005 09:37 PM
unknown terminal type BroX Linux - Networking 0 06-02-2004 04:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration