• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

setxkbmap: command not found

by Deepika

setxkbmap is a command-line utility that allows users to configure the keyboard layout using the X Keyboard Extension (XKB) in Unix-like systems. XKB is a component of the X Window System that provides a flexible and customizable method for configuring keyboard layouts and input methods.

setxkbmap is typically used to change the keyboard layout or to configure special keys and options associated with the keyboard. It can be used to set the language of the keyboard, modify the behavior of modifier keys like Shift, Alt, and Ctrl, or to set the behavior of other keys like function keys or multimedia keys.

For example, the command setxkbmap -layout us sets the keyboard layout to the US layout, while the command setxkbmap -option ctrl:nocaps sets the behavior of the Ctrl key so that it does not act as a Caps Lock key.

setxkbmap can also be used to configure input methods for languages that require complex input methods, such as Chinese or Japanese. Input methods are used to input complex characters or symbols by typing in sequences of keystrokes.

setxkbmap is a powerful tool that can be used to customize the behavior of the keyboard in a wide range of ways. However, it is important to note that incorrect configuration settings can cause input errors or unexpected behavior, so users should refer to the setxkbmap manual page or documentation for more information on specific usage and options.

If you encounter the below error while running the command setxkbmap:

setxkbmap: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install x11-xkb-utils
Ubuntu apt-get install x11-xkb-utils
Arch Linux pacman -S xorg-setxkbmap
Kali Linux apt-get install x11-xkb-utils
CentOS yum install xorg-x11-xkb-utils
Fedora dnf install xorg-x11-xkb-utils
Raspbian apt-get install x11-xkb-utils

setxkbmap Command Examples

1. Set the keyboard in French AZERTY:

# setxkbmap fr

2. Set multiple keyboard layouts, their variants and switching option:

# setxkbmap -layout us,de -variant ,qwerty -option 'grp:alt_caps_toggle'

3. Get help:

# setxkbmap -help

4. List all layouts:

# localectl list-x11-keymap-layouts

5. List variants for the layout:

# localectl list-x11-keymap-variants de

6. List available switching options:

# localectl list-x11-keymap-options | grep grp:

Summary

Overall, setxkbmap is a useful tool for configuring keyboard layouts and input methods in Unix-like systems. It provides a flexible and customizable method for configuring the keyboard and can be used to optimize the keyboard for specific languages, users, or applications.

Filed Under: Linux

Some more articles you might also be interested in …

  1. iptables Command Examples in Linux
  2. clear: Clears the screen of the terminal (Command Examples)
  3. ipcrm Command Examples in Linux
  4. How to Delete unnecessary Entry in /etc/shadow
  5. exercism: Download and solve problems from the command-line
  6. gpgv Command Examples
  7. startx Command Examples in Linux
  8. Using vmstat to troubleshoot performance issues in Linux
  9. How to disable write access to USB devices using “hdparm” tool
  10. isosize Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright