Set Linux Console Keyboard Repeat Rate with kbdrate
By the end of this guide, you will have changed the repeat delay and speed for the Linux virtual console, or confirmed that this machine does not expose a keyboard interface that kbdrate can use. The command affects console keyboard handling, not the repeat settings of a graphical desktop session.
The route
Jump straight to the step you need, or tick off Done means at the end.
Prerequisites: the kbd package and a Linux virtual console. The examples use kbd 2.6.4, installed here as Ubuntu package 2.6.4-2ubuntu2. Allow about five minutes for a one-off adjustment. You will normally need root privileges because the program talks to the kernel keyboard interface.
Checkpoint 1: confirm the program and version
Start by checking which implementation is installed. This catches a surprisingly common distraction: reading documentation for a different copy of the command than the one on your path.
$ command -v kbdrate
/usr/sbin/kbdrate
$ kbdrate --version
kbdrate from kbd 2.6.4
The local manpage describes the traditional rate and delay options. This installed 2.6.4 build also accepts --print, which reports current values without changing them. Its help output is the most reliable option list for this binary:
$ kbdrate --help
Usage: kbdrate [option...]
Options:
-r, --rate=NUM set the rate in characters per second.
-d, --delay=NUM set the amount of time the key must remain depressed before it will start to repeat.
-p, --print do not set new values, but only display the current ones.
-s, --silent suppress all normal output.
-V, --version print version number.
-h, --help print this usage message.
Checkpoint 2: test whether the console exposes the interface
Run the read-only form before choosing values. It is safe to run as an ordinary user, although the result depends on the terminal from which you run it.
$ kbdrate --print
Not supported
The exact output is hardware and kernel dependent. On this machine, running it outside a supported virtual console returns Not supported. That is a capability result, not evidence that your chosen rate is invalid. Switch to a Linux virtual terminal, usually with Ctrl+Alt+F3, log in there, and run the check again. Return to the graphical session with the desktop's usual terminal shortcut, often Ctrl+Alt+F1 or F2, depending on the display manager.
Checkpoint 3: choose a delay and rate
The delay is how long a key must remain depressed before repetition begins. The rate is the number of repeated characters per second after that delay. A longer delay helps prevent accidental repeats; a lower rate gives you more time to release a key once repetition starts.
On Intel-compatible systems, the manpage gives a delay range of 250 to 1000 milliseconds in 250 ms steps. The documented rate range is 2.0 to 30.0 characters per second, but only specific rates are available. The program selects the nearest supported value. For example, 12.0 is one of the listed values, while an arbitrary value such as 11.5 may be rounded.
SPARC has different limits: rates from 0 to 50 cps and delays from 10 to 1440 ms in 10 ms steps. The command is architecture dependent, so do not copy Intel values into a deployment policy for another architecture without testing them.
Checkpoint 4: apply a temporary setting
Warning
This changes keyboard behaviour immediately for the console. It is reversible, but do not test an extreme setting on a remote recovery console or while operating equipment that depends on predictable keyboard input.
Use sudo for a normal administrator account. This example makes repetition begin after 500 ms and run at 12 cps:
$ sudo kbdrate --delay=500 --rate=12.0
# normal output is implementation dependent
Output varies with the kernel and keyboard. Some systems print the selected values; --silent suppresses normal messages if you are calling the command from a script. A successful-looking command still deserves a read-back where the interface supports it:
$ sudo kbdrate --print
# output varies, or may say Not supported
If the read-back says Not supported, test from a virtual console rather than repeating the write command. If the command reports an invalid value, use a documented step such as 250, 500, 750 or 1000 ms for the delay, and a listed rate such as 10.9 or 12.0 cps on Intel hardware.
Checkpoint 5: restore the documented defaults
Running kbdrate with no options resets Intel and M68K systems to the IBM defaults of 10.9 cps and 250 ms. It resets SPARC systems to 5 cps and 200 ms. This is an active change, so use elevated privileges:
$ sudo kbdrate
# normal output is implementation dependent
On a system where the command supports read-back, confirm the reset:
$ sudo kbdrate --print
# output varies, or may say Not supported
Do not assume that this adjustment persists across a reboot. The manpage lists /etc/rc.local as a related file, but it does not prescribe a modern service configuration. If you need a persistent policy, put the tested command into the startup mechanism already used by your distribution, and document the target console and architecture. Test that startup change from a local recovery path before relying on it.
Common traps and failure recovery
- Graphical terminal versus virtual console:
kbdratecontrols the Linux console keyboard interface. Desktop environments usually manage their own repeat settings, so a successful console change may not alter an X11 or Wayland application. - Unsupported hardware: the manpage warns that not all keyboards support every rate and that mappings differ between keyboards. Keep the previous working values recorded before experimenting.
- Unexpected rounding: a requested rate is not necessarily the rate the hardware can represent. Read it back, and treat the reported value as authoritative.
- Permission errors: rerun the write command with
sudo; do not make the executable or device files broadly writable. - No recovery console: if a setting makes input awkward, use another local virtual terminal or an out-of-band console and restore the documented defaults with
sudo kbdrate.
Done means
kbdrate --versionidentified the installed kbd version.- You tested from a Linux virtual console and know whether the interface is supported.
- The chosen rate and delay are within the limits for the machine's architecture.
- A read-back confirmed the result, or the command's
Not supportedresponse is understood and recorded. - You know how to restore the documented defaults with
sudo kbdrate.