After the installation of OSX Lion, I tried to:
nano /etc/apt/sources.list
But I get this error:
Error opening terminal: xt
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.