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.

[root@nosebleed ~]# lsmod | grep pcspkr

pcspkr                  7105  0

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

[root@nosebleed ~]# rmmod pcspkr

[root@nosebleed ~]# lsmod | grep pcspkr

3. Restore the module when done.

[root@nosebleed ~]# modprobe pcspkr

[root@nosebleed ~]# lsmod | grep pcspkr

pcspkr                  7105  0

Permanent solution,

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

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

[root@nosebleed ~]# vi /etc/modprobe.d/blacklist

Add the lines below to the file.

# pcspkr - turn off pc speaker "BEEP!"

blacklist pcspkr

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

[root@nosebleed ~]# lsmod | grep pcspkr

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

9 Responses to “How to disable the beep in Linux”

Author comments are in a darker gray color for you to easily identify the posts author in the comments

  1. mysurface says:

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

  2. Danny says:

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

  3. Thaweesak says:

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

  4. Kharn says:

    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 …

  5. James Chase says:

    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.

  6. Danny says:

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

  7. Burkass Tchaikovsky says:

    @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 :)

  8. Burkass Tchaikovsky says:

    @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 :)

  9. lincoln says:

    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!

Leave a Reply

© 2008-2009 The Danesh Project
Powered by Wordpress and made by Guerrilla. Best viewed in Mozilla Firefox