After the installation of OSX Lion, I tried to:
nano /etc/apt/sources.list
But I get this error:
Error opening terminal: xt
I hear that this can be fixed by overwriting your /usr/share/terminfo
with one from the computer of somebody with a working install of Lion. I can't confirm whether this works or not, and unfortunately I haven't upgraded yet, so I can't provide you with that file.
You can add the following in your .bashrc
if [ "$TERM" = xterm ]; then TERM=xterm-256color; fi
After upgrading to OSX Lion, I started getting this error on certain (Debian/Ubuntu) servers. The fix is simply to install the “ncurses-term” package which provides the file /usr/share/terminfo/x/xterm-256color.
This worked for me on a Ubuntu server, via Erik Osterman.
I, too, have this problem on an older Mac that I upgraded to Lion.
Before reading the terminfo tip, I was able to get vi and less working by doing "export TERM=xterm".
After reading the tip, I grabbed /usr/share/terminfo
from a newer Mac that has fresh install of Lion and does not exhibit this problem.
Now, even though echo $TERM
still yields xterm-256color
, vi and less now work fine.
On Red Hat this worked for me:
export TERM=xterm
further info here: http://www.cloudfarm.it/fix-error-opening-terminal-xterm-256color-unknown-terminal-type/
I can confirm this is a terminfo issue. This is what worked for me. SSH in to the remote machine and run
sudo apt-get install ncurses-term
Boom. Problem solved.