Turn off system beep on Linux

The other day I was typing on my notebook on a very quiet location which meant that for the first time I noticed the annoying beep (audio alert) caused by errors I make on the command line. The beep is actually an audio alert warning that an error was made, keeping that in mind lets continue.

To disable audio alerts the module pcspkr should be black listed, then Linux will have no idea on how to contact the buit-in speaker and cause the annoying beep.

First open and edit the system black list and add pcspkr module to the list. You will need root to edit this file.

nano /etc/modprobre.d/blacklist

Then black list the module pcspkr by adding it to the bottom of the list.

# Disable built-in speaker
blacklist pcspkr

From now on when the system starts pcspkr module will not be loaded. This will not disable the external audio speakers, but the built-in speaker on most motherboards.