Yes, you can fix or disable the lock key tones (the beep when you press Caps Lock, Num Lock, or Scroll Lock) directly in Ubuntu’s sound settings, but the exact option depends on your desktop environment. On default GNOME (Ubuntu 22.04 and later), there is no simple toggle for these tones in the Settings app; you need to use a terminal command or install a small extension. On older Unity or Xfce versions, the toggle was built into the sound settings panel.
What Causes Lock Key Tones?
The tones you hear when pressing Caps Lock, Num Lock, or Scroll Lock are generated by the system’s keyboard bell, not by the speaker or the desktop environment’s notification sound. This is a legacy feature from the early PC era, when the keyboard itself contained a small speaker. Modern keyboards don’t have that speaker, so the operating system emulates the beep through your computer’s audio output.
On Ubuntu, this emulation is handled by the pcspkr kernel module (for the internal PC speaker) or by the desktop environment’s accessibility settings. The sound is intentionally separate from other system sounds so that it can be used even when the audio system is not fully loaded. That separation is also why the main volume slider often doesn’t affect it.
How to Disable Lock Key Tones in GNOME (Default Ubuntu)
Ubuntu’s default desktop, GNOME, removed the graphical toggle for keyboard bell sounds several versions ago. The option still exists in the system’s underlying configuration, but you must access it via the command line or a GNOME extension.
Method 1: Terminal command (works on all current Ubuntu versions)
- Open a terminal (Ctrl+Alt+T).
- Run this command to disable the keyboard bell entirely:
gsettings set org.gnome.desktop.sound event-sounds false - To re-enable it later, run:
gsettings set org.gnome.desktop.sound event-sounds true
This command disables all event sounds (like the drum sound when you plug in a USB device), not just lock key tones. If you want to keep other event sounds but silence only the lock keys, you need a more targeted approach.
Method 2: Use a GNOME extension
Search for “Keyboard Bell” or “Sound Input & Output” in the GNOME Extensions website. Several extensions add a simple on/off switch for the keyboard bell to the Settings app. These extensions are maintained by the community and are not part of the default Ubuntu install, so they may break after a system update.
How to Disable Lock Key Tones in Other Ubuntu Flavors
If you use Kubuntu (KDE), Xubuntu (Xfce), or Lubuntu (LXQt), the process is different and often easier.
- Kubuntu (KDE Plasma): Go to System Settings → Accessibility → Bell. Uncheck “Enable the bell” or set it to “Visual only.”
- Xubuntu (Xfce): Go to Settings → Accessibility → Keyboard. There is a checkbox for “Enable keyboard accessibility features” and a separate option for “Beep when a modifier key is pressed.” Uncheck the latter.
- Lubuntu (LXQt): Go to Preferences → LXQt Settings → Keyboard and Mouse. Look for a “Keyboard Bell” section and set it to “Off.”
Common Problems and Workarounds
Many users try to mute the lock key tones by lowering the system volume or muting the microphone, but that doesn’t work because the bell bypasses those controls. Here are the most common issues and their fixes:
- The gsettings command doesn’t work on Wayland. On Ubuntu 22.04 and later, the default session uses Wayland. The gsettings command works on Wayland, but if you are using an older version or a non-GNOME session, try running it with
gsettings --schemadir /usr/share/glib-2.0/schemasif you get a schema error. - The beep comes from the PC speaker, not the sound card. If you have an older system or a custom kernel, the beep may be generated by the
pcspkrmodule. To disable it permanently, runsudo modprobe -r pcspkrand addblacklist pcspkrto a file in/etc/modprobe.d/. - The beep only happens in the terminal. If the sound occurs when you press Caps Lock in a terminal window, it’s the terminal’s own bell. In GNOME Terminal, go to Preferences → Your Profile → Sound and uncheck “Terminal bell.”
How to Test Your Changes
After applying any of the fixes, press Caps Lock a few times. If you still hear the tone, check whether the sound is coming from the terminal or the whole system. If it’s only in the terminal, use the terminal-specific setting. If it’s everywhere, the gsettings command or the extension should have silenced it.
Note that some applications (like LibreOffice or older Java apps) have their own keyboard bell settings that override the system setting. In LibreOffice, go to Tools → Options → Accessibility and uncheck “Use text cursor blinking” or look for a “Beep” option.
Comparing the Options
Here’s a quick comparison of the three main approaches:
- gsettings command: Free, no extra software, works on all GNOME versions, but disables all event sounds.
- GNOME extension: More precise, but requires installing third-party software and may break after updates.
- Desktop flavor settings: Built-in and easy, but only available on non-GNOME flavors.
For most users, the gsettings command is the simplest and most reliable. If you only want to silence the lock keys and keep other sounds, the extension is the better choice, but be prepared to maintain it.
Safety and System Impact
Disabling lock key tones is completely safe and reversible. It does not affect the functionality of the Caps Lock, Num Lock, or Scroll Lock keys themselves—only the audible feedback. The gsettings command only changes a user-level configuration, not a system file, so you don’t need sudo and you can switch it back at any time.
If you choose to blacklist the pcspkr module, that is a system-level change. It only affects the PC speaker, not your sound card or other audio devices. It is safe, but you should know how to reverse it (remove the blacklist file) if you ever need the speaker for troubleshooting (e.g., when the system fails to boot and you need to hear the POST beeps).
Frequently Asked Questions
Why don’t I see a “Lock Key Tones” option in Ubuntu Settings?
GNOME removed that option from the graphical settings interface starting with version 3.10 (around 2013). The setting still exists in the system’s dconf database, but it’s not exposed in the UI. That’s why you need to use the terminal or an extension.
Will the gsettings command affect my login screen?
No, the gsettings command only affects your user session. The login screen (GDM) has its own separate configuration. If you want to disable the bell on the login screen as well, you would need to run the same command as the gdm user, which is not recommended for beginners.
Can I make the lock key tones play through headphones only?
No, the keyboard bell is always routed to the default output device. There is no way to separate it from other system sounds. If you want to hear it only in headphones, you would need to set the headphones as the default output device, which would also affect all other sounds.
Is there a way to change the lock key tone to a different sound?
Not directly. The keyboard bell is a simple square wave beep, not a sound file. You could use a tool like sox to create a custom event sound and assign it to the bell, but that requires advanced configuration and is not supported by the default desktop.
Does this fix work on Ubuntu 20.04 or older?
Yes, the gsettings command works on Ubuntu 18.04 and 20.04 as well. On those versions, you might also find the option in Settings → Sound under “Alert Sound” or “Sound Effects.” If you have an older version with Unity (Ubuntu 16.04 and earlier), look in System Settings → Sound → Sound Effects and uncheck “Play sound when a key is pressed.”
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Show User Library in macOS High Sierra & Sierra
- Device Manager Shortcut: Windows 10 Desktop
- How to Remove Forgotten Passcode from iPhone
- Fix Slow Wi-Fi Problem iPhone X: 9 Steps
- How to Check if a Candidate Accepts Crypto Donations
- How to Listen to Deleted Voicemails on iPhone