I run Xorg/X11 on Debian testing. AFAIK, the only way to modify or add
keyboard layouts with XKB in that configuration is to modify or add
files below `/usr/share/X11/xkb'. At least that is what you get when
you search for "xorg configure keyboard layout" on the web.
However, the upgrade of xkb-data from 2.42.* to 2.46.* breaks in the
presence of extra files below `/usr/share/X11/xkb', at least when
executed from `unattended-upgrade':
,----
| Log started: 2026-01-09 11:13:50
| (Reading database ... 102524 files and directories currently installed.)
| Preparing to unpack .../console-setup-linux_1.245_all.deb ...
| Unpacking console-setup-linux (1.245) over (1.244) ...
| Preparing to unpack .../console-setup_1.245_all.deb ...
| Unpacking console-setup (1.245) over (1.244) ...
| Preparing to unpack .../keyboard-configuration_1.245_all.deb ...
| Unpacking keyboard-configuration (1.245) over (1.244) ...
| Preparing to unpack .../xkb-data_2.46-2_all.deb ...
| dpkg-maintscript-helper: error: file '/usr/share/X11/xkb/symbols/jens' not owned by package 'xkb-data:all'
| dpkg-maintscript-helper: error: file '/usr/share/X11/xkb/rules/evdev.xml.orig' not owned by package 'xkb-data:all'
| dpkg-maintscript-helper: error: directory '/usr/share/X11/xkb' contains files not owned by package xkb-data:all, cannot switch to symlink
| dpkg: error processing archive /var/cache/apt/archives/xkb-data_2.46-2_all.deb (--unpack):
| new xkb-data package pre-installation script subprocess returned error exit status 1
| Errors were encountered while processing:
| /var/cache/apt/archives/xkb-data_2.46-2_all.deb
| Log ended: 2026-01-09 11:13:55
`----
(See also Debian bug #1122650 for details, where tg@debian.org
has mentioned that fact already without - IMO - stressing it
enough.)
So probably instead of just bailing out when `dpkg-maintscript-helper'
reports in issue, how about renaming the directory tree during preinst
to make place for the symlink? Like this (completely untested):
,----
| dpkg-maintscript-helper dir_to_symlink /usr/share/X11/xkb /usr/share/xkeyboard-config-2 2.46-2\~ -- "$@" ||
| {
| mv /usr/share/X11/xkb /usr/share/X11/xkb.dpkg-old &&
| dpkg-maintscript-helper dir_to_symlink /usr/share/X11/xkb /usr/share/xkeyboard-config-2 2.46-2\~ -- "$@"
| }
`----
That would leave the conf files around for a user to move them to the
new location when she notices that her nice layout does not work as
expected.
Otherwise, if you decide to keep the current behavior, I guess at least
a warning in the release notes would be in order, since I expect to
break future upgrades from trixie to forky in the presence of user
configuration below `/usr/share/X11/xkb'.