The problem is caused by there being no entry for the current $TERM under /usr/share/terminfo.
To fix the problem install the ncurses-term package.
If that doesn't work (there is no file for the specific $TERM), a "good enough" workaround may be to symlink a similar file. For example, assuming $TERM is rxvt-unicode-256color and /usr/share/terminfo/r/rxvt-unicode-256color does not exist:
:
# echo $TERM
rxvt-unicode-256color
# cd /usr/share/terminfo/r/
/usr/share/terminfo/r# ls
[snip output which included rxvt-256color]
/usr/share/terminfo/r# ln -s rxvt-256color rxvt-unicode-256color
For a proper fix, find a terminfo file for the current $TERM's terminal type. If it is not already compiled, the tic command can be used to compile it.