Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 use a Turkish keyboard which i have converted to English(Ubuntu server 12.04). My problem is that the single quote is not present on the keyboard but is instead represent by a comma in midair. To fix this i use the command

sudo dpkg-reconfigure keyboard-configuration

The problem is each time i shutdown,changes are reverted thus everytime i start the system, i have to type that command. I was thinking of making it a cronjob but i`m sure there can be another way to make the changes permanent.

share|improve this question
    
could i help you sir ? – Private Oct 7 '13 at 13:57
up vote 3 down vote accepted

using sudo dpkg-reconfigure keyboard-configuration will change your keyboardlayout just for this session.

go for sudo nano /etc/default/keyboard there you can change your keyboard settings.

Find the line :

XKBLAYOUT="xx"

You can change layout and kboptions as well as your model and the kbvariant.

Just put in tr for Turkish

Keyboard File

on older ubuntu versions you could go for dpkg-reconfigure console-setup and make permanently changes here. but for server 12.04 I guess it should be in the keyboard file.

share|improve this answer
    
This does not work by ubuntu server 14.04. I replaced the "us" with "hu" (Hungarian), but after reboot I still have English layout instead of Hungarian. sudo dpkg-reconfigure keyboard-configuration worked for me, and it is permanent, I have Hungarian layout after reboot. – inf3rno Feb 5 at 13:42

For console-only instances e.g. servers, you should install the console-data package with apt-get install console-data and then set it up with dpkg-reconfigure console-data.

share|improve this answer

To change it permanently via the terminal run this:

For US:

L='us' && sudo sed -i 's/XKBLAYOUT=\"\w*"/XKBLAYOUT=\"'$L'\"/g' /etc/default/keyboard

For French:

L='fr' && sudo sed -i 's/XKBLAYOUT=\"\w*"/XKBLAYOUT=\"'$L'\"/g' /etc/default/keyboard

For German:

L='de' && sudo sed -i 's/XKBLAYOUT=\"\w*"/XKBLAYOUT=\"'$L'\"/g' /etc/default/keyboard

and so on...

Tested on Ubuntu 16.04 64 bit.


To change it temporarily you can use setxkbmap mylayout...

# US
setxkbmap us
# French
setxkbmap fr
# German
setxkbmap de

In terminal mode, you need to use loadkeys instead of setxkbmap

# US
loadkeys us
# French
loadkeys fr
# German
loadkeys de
share|improve this answer

Your Answer

 
discard

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.