Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a chroot with the help of jailkit and now I'm trying to install some other libraries and tools.

First I tried to install clear library. I've copied the file from the /bin folder and copied the dependencies to the chroot. However, when I entered the clear command, it says:

TERM environment variable not set.

So, when I'm logged in as root, the value of TERM is xterm-256color. But when I enter export TERM=xterm-256color, it says unknown terminal type.

What should I do?

share|improve this question
What exact commands did you use to enter the chroot and run clear? – Gilles Jul 21 '13 at 21:15

clear depends on terminfo. terminfo uses the value of $TERM as a key to look up the proper escape sequences for your terminal in its database. You need to copy the terminfo database files for the terminal types you want to be supported in the chroot. You'll find them in /lib/terminfo or /usr/share/terminfo. If the files aren't found, terminfo can't do anything but tell you that it doesn't recognize your terminal type.

share|improve this answer

You likely want to install a shell in the chroot.

Also, debian has a very useful tool for populating chroots with a debian system, look at the man page for debbootstrap for more.

share|improve this answer

A good suggestion from the Gentoo alt-install doc: Instead of chroot /your/chroot/path /bin/bash run

chroot /your/chroot/path /bin/env -i TERM=$TERM /bin/bash

env -i will clean the environment (the chroot-environment is probably different or even incompatible), while the TERM=$TERM will make the chrooted bash aware of the parent's TERM variable ($TERM is expanded by the parent shell before executing the commands).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.