Advanced desktop manager as: GNOME, KDE, XFCE offered an easy way to change the keyboard setting using GUI, distributions as BLAG, CentOS, RHEL and Fedora offer the tool: system-config-keyboard; but also we can use the setxkbmap command. setxkbmap allows you to change the settings on our keyboard for X sessions.
Change the keyboard language:
Spanish
$ setxkbmap es
English
$ setxkbmap us
US, International with dead keys
$ setxkbmap -layout us -variant intl