How to disable the beep in Linux

If you are like me then you must hate the “BEEP!” that comes along with Linux. Turning it off in KDE or Gnome is easy but what if you are on the virtual console? Here’s how you get rid of the “BEEP!” temporarily or permanently.

Temporary solution,

** make sure to be root or use sudo **

1. Check if you have the pcspkr module loaded.

2. Remove the module. lsmod will return nothing if the module was removed.

3. Restore the module when done.

Permanent solution,

** make sure to be root or use sudo **

1. add the pcspkr module to the modprobe blacklist file.

Add the lines below to the file.

2. Reboot, and check if the pcspkr module was loaded. If the blacklist file kicked in then nothing will be returned.

This fix works for my CentOS and Ubuntu but not openSUSE as the pcspkr driver is built right into the kernel.

  • Cool! is it the same way i have to do for Freebsd?

  • Yup, should work just fine. Have you tried it yet?

  • I think it’s easier to simply unplug the small speaker from your motherboard. 🙂 It’s a cross platform solution too.

  • Kharn

    All good unless you have a surface mounted speaker … then you can’t unplug it …

    now i need to work out how to get it to play tunes for me …

  • James Chase

    This was driving me INSANE while developing in a virtual machine of CentOS 5.1 since with a virtual machine the “Beep” is played through my stereo speakers instead of the quieter pc speaker…

    However your permanent solution didn’t work for me. I added “install pcspkr true” to my blacklist file, and this did solve my problem. Not sure of the reasoning.

  • Good to hear it worked for you James, I faced the same thing while working on VM too.

  • Burkass Tchaikovsky

    @thaweesak

    i think that’s a bad idea, i mean how if we have problem with motherboard. Beep from is detector what error do you have in motherboard 🙂

  • Burkass Tchaikovsky

    @thaweesak

    i think that’s a bad idea, i mean how if we have problem with motherboard. Beep from motherboard’s speaker is detector what error do you have in motherboard 🙂

  • lincoln

    Hello dude, I’d like to thank you for pointing this simple way for turning that annoying beep off.

    @thaweesak: Hehe, my notebook is quite new and it is in the warranty period. Anyway, a rmmod is quite easier =P

    Thank you!

  • NLE

    The blacklist solution didn’t work for me with CentOS 5.5. But this works:

    Add the following line in /etc/modprobe.conf

    alias pcspkr off

    Source: http://bugs.centos.org/view.php?id=2246

  • Pingback: Disable/Mute System Beep di OpenSuSE 11.3 « harian k_de (kdenotes)()

  • Jamie

    really great, thanks a lot!

    I usually use “xset -b” in my .bashrc, but during a late-night disk repair-athon you don’t have X-server and you don’t want that beep!

    Still leads me to wonder if there’s some way of controlling the properties of the speaker!?

  • Baptiste

    This beep is just horible !!!
    I remenber when BEEP in library 🙁
    Thanks you very very 🙂

© 2008-2012 The Danesh Project
Powered by Wordpress and made by Guerrilla. Hosted at ServerFreak