From charlesreid1

Remapping Caps Lock to Control Key

Remap keyboard: use caps lock as a control key

Edit /etc/default/keyboard to include the line:

XKBOPTIONS="ctrl:nocaps"

Then reconfigure the current keyboard layout with the command:

dpkg-reconfigure keyboard-configuration

or alternatively, set the option from the command line with the command:

/usr/bin/setxkbmap -option "ctrl:nocaps"

Flags