【问题标题】:top 'xterm': unknown terminal type顶部'xterm':未知终端类型
【发布时间】:2014-08-31 20:05:12
【问题描述】:

运行 TOP 命令时出现错误:

>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

Root 也有这个问题。

TOP 使用 xterm 吗?

我该怎么办?

【问题讨论】:

  • 我正在通过 putty.exe 使用 ssh
  • DYSPLAY:未定义变量?!?
  • DYSPLAY?你在 .profile 或类似的地方有错字

标签: linux shell command redhat


【解决方案1】:

这是top 终端问题的另一个可能原因。

我遇到了同样的问题(在一个特定的 SLES 11.3 机器上) - 无论我将 TERM 设置为什么(默认为 xterm),顶部都会说“unknown terminal type”。
我的/usr/share/terminfo 文件都很好,/etc/termcap 和我的 ncurses 库也是如此。

然后我注意到top作为另一个用户运行良好,所以它一定是环境问题。 我追踪到LD_LIBRARY_PATH,它被设置为
/opt/PostgreSQL/9.3/pgAdmin3/lib:/opt/PostgreSQL/9.3/lib:
(我在这个盒子上安装了 PostgreSQL)。

问题在于 PostgreSQL 提供了自己的 libncurses.so.5 库(以及许多其他库),而 top 无法使用它。

如果我取消设置 LD_LIBRARY_PATH,或者将 PostgreSQL 的库设置为指向 /usr/lib/libncurses.so 的软链接,那么 top 将再次正常工作。

【讨论】:

  • 这正是我的问题。我最终将 LD_LIBRARY_PATH 设置移动到包装器 shell 脚本而不是 Dockerfile 上
【解决方案2】:

尝试添加

export TERM=linux

在 .bashrc 文件的末尾(/home/myuser/.bashrc、/root/.bashrc)。问题是终端定义'xterm'未定义

【讨论】:

  • export TERM=linux -> top -> 'linux': 未知终端类型。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-10-22
  • 1970-01-01
  • 2011-10-10
相关资源
最近更新 更多