Debian - How to turn off the system bell

It is very annoying to hear loud beeps at home especially at night or when listening to music. To turn off the system bell just follow a couple of steps below and enjoy pure silence.

First step - turn off the system bell in console

To turn off the console bell edit /etc/inputrc configuration file and uncomment line:

set bell-style none

Second step - turn off the system bell in Xorg

To turn off the system bell in Xorg edit ~/.bashrc file and append code:

if [ -n "$DISPLAY" ]; then
  xset b off
fi

To check bell settings in Xorg execute command:

$ xset q | grep bell
  bell percent:  0    bell pitch:  400    bell duration:  100

Third step

Reboot system so the changes take effect.

Alternative solution

This solution did not worked for me.

Blacklist pcspkr module:

$ sudo echo "blacklist pcspkr" > /etc/modprobe.d/pcspkr-blacklist.conf

Generate a list of module dependencies:

$ sudo depmod -a

Update an initramfs image:

$ sudo update-initramfs -u

Reboot system.

Sources

Milosz Galazka's Picture

About Milosz Galazka

Milosz is a Linux Foundation Certified Engineer working for a successful Polish company as a system administrator and a long time supporter of Free Software Foundation and Debian operating system.

Gdansk, Poland https://sleeplessbeastie.eu