Desktop, X11 & Wayland

XKB cannot compile the configured keyboard layout

A layout typo or missing include can prevent keymap compilation. Test the selected names without applying an experimental map to the session.

On this page
  1. Symptoms & scope
  2. Possible causes
  3. Diagnose safely
  4. Evidence-guided next steps
  5. References & review
  6. Related problems

Symptoms & scope

  • The compositor rejects a keyboard layout setting.
  • Logs identify a missing symbols include or failed keymap compilation.

Relevant environment

libxkbcommon-based desktops and compositors; xkbcli is supplied by a distribution-specific tools package. Xorg has different include-path rules.

Recognizable messages (synthetic examples)
xkbcommon: ERROR: Couldn't find file "symbols/example-layout" in include paths

Inspect the layout code and include path before changing keyboard hardware or input drivers.

xkbcommon: ERROR: Failed to compile xkb_symbols

Read the preceding compiler error to separate missing includes from invalid custom syntax.

Possible causes

These are possible explanations, not a confirmed diagnosis. Several independent faults can coexist.

  • A human language name may have been used instead of an XKB layout or variant code.
  • A custom symbols file or xkeyboard-config resource may be absent from the active include paths.

Diagnose safely

Run one command at a time in the relevant session. Read the explanation first. Uppercase placeholders need your own values; tools and privileges vary by distribution. These commands are displayed here and never executed by the website.

Check 1

Replace LAYOUT and VARIANT with the configured codes; omit --variant if none is configured. Compiles to output without changing the active keyboard.

xkbcli compile-keymap --layout LAYOUT --variant VARIANT

Interpret the result: A compiler error identifies the missing symbols or syntax. A successful compile does not prove the compositor loads the same configuration.

Check 2

Reads custom include-path variables without loading a keymap. Check compositor-specific environment separately when necessary.

printenv XKB_CONFIG_ROOT XKB_CONFIG_EXTRA_PATH XDG_CONFIG_HOME

Interpret the result: A custom root can hide distribution layouts. User configuration and privileged contexts may search different paths, so root is not an equivalent test.

Evidence-guided next steps

Correct the layout and variant codes

If the missing symbol names come from a typo, save the compositor’s keyboard configuration and choose an installed layout/variant pair through its settings. Compile that pair first, then apply only the keyboard change through the desktop’s supported reload or relogin.

Precautions: Keep a working fallback layout and another input/recovery path; an invalid active map can prevent typing a rollback command.

Recovery / rollback: Restore the saved keyboard settings and apply the previous working layout through the same session mechanism.

Did this solution help you?

Share this solution#

Repair the specific custom include or resource package

If a custom layout is intentional, place only its missing resource in the documented user include location and test it from a temporary include path before activating it. If standard layouts are missing, repair the owning xkeyboard-config package through the distribution.

Precautions: Do not overwrite system symbols files or assume Xorg honors libxkbcommon’s user include paths.

Recovery / rollback: Remove the added custom resource or restore its saved version and the original include-path setting.

Did this solution help you?

Share this solution#

References & review

This guide was prepared from primary project or distribution sources and reviewed on the date shown. This is an editorial source check, not evidence that a fix was reproduced on your hardware. Diagnostic log examples are synthetic fixtures. Version-dependent details must be checked against your installed release.