Normally, if you try the key sequence Alt+1 in xterm, it will output a special character. To enable the Alt key:

Add the following to the .inputrc file in your home directory. Create one if it doesn’t exist already.

set meta-flag on
set convert-meta off
set output-meta on

Add the following to the .Xdefaults file in your home directory.

XTerm*metaSendsEscape: true
XTerm*eightBitInput: false

Open xterm if its not already, and execute the following command in the xterm Window.

xrdb -load ~/.Xdefaults

Restart all xterm windows. The Alt key should work now.