3

I know that this question has been posted a zillion times, but none of the answers I could find have solved it for me.

I have a root shell given by sudo bash. When I try to use man, I have this message:

WARNING: terminal is not fully functional
-  (press RETURN)

and limited control on navigation.

It works when I'm not root. As root, aptitude works correctly. I've tried to export TERM with: linux, xterm, xterm-color, xterm-256color, ansi, screen-256color, ncurses, vt100.

The ouput of stty -a is exactly the same as root and non-root:

speed 38400 baud; rows 30; columns 271; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

I'm stuck.

Any idea?

Thanks in advance

3
  • none of the answers I could find have solved it for me – Please link to these answers or cite them in the question body (edit the question). I guess you don't want us to give you answers you have already tried. So what are they? Commented Mar 22, 2020 at 14:48
  • I've tried to export TERM with: linux, xterm, xterm-color, xterm-256color, ansi, screen-256color, ncurses, vt100. These are the answers I could gather. Users report that sometimes it works, sometimes it doesn't. Which leads me to think it's probably related to something else than "TERM", but I couldn't find out what. I just wanted to point out that I did some research before posting my question.
    – greg
    Commented Mar 26, 2020 at 16:12
  • Same problem here only on CentOS. Every single thing I've found says "set TERM" but TERM is set to something valid, and changing it does nothing. Commented Nov 22, 2022 at 19:36

2 Answers 2

1

I ended up solving this myself by adding a missing ncurses package which provides /usr/share/terminfo. This package, which for whatever reason of package dependency hell, wasn't installed, seems to fix this. Though in my case it happened to both root and non-root users alike, so it might not be it, but worth posting I think in case anyone is in my situation in the future and comes across this question in Google results.

On CentOS, it's ncurses-base.

On Debian 11 (and likely Ubuntu's), it's ncurses-term.

If you're missing those packages, try installing them and seeing if that helps.

I found this by trying to do reset on the terminal, and the resulting "Terminal type?" prompt rejecting everything I tried, e.g.

Terminal type? screen                                      
reset: unknown terminal type screen
Terminal type?                                             
Terminal type? vt100
reset: unknown terminal type vt100

That got me comparing it against a working system, and looking for anything that included the name vt100. A bit of digging through the grep -r results led me to the files under /usr/share/terminfo which were missing on the "bad" system. A call to rpm -q --whatprovides /usr/share/terminfo/v/vt100 led me to that package name.

0

Almost 3 years later, ChatGPT gave me the solution...

# type man
man is aliased to `TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man'

at some point "man" was aliased to a bogus line... that explains why the other users were unaffected...

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Feb 15, 2023 at 16:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .