How to disable the beep in Linux

20 Feb, 2008  |  Posted by Danesh  |  in HowTo, Linux, hacks

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.

  • Digg
  • del.icio.us
  • BlinkList
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Furl
  • Google
  • Live
  • Facebook
  • Pownce
  • TwitThis
  • E-mail this story to a friend!
  • LinkedIn
  • Ping.fm
Tags: , , , , , ,

6 Responses so far | Have Your Say!

  1. mysurface  |  February 24th, 2008 at 5:05 am #

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

    mysurface - Gravatar
  2. Danny  |  February 24th, 2008 at 1:54 pm #

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

    Danny - Gravatar
  3. Thaweesak  |  March 1st, 2008 at 7:12 pm #

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

    Thaweesak - Gravatar
  4. Kharn  |  March 14th, 2008 at 6:05 pm #

    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 …

    Kharn - Gravatar
  5. James Chase  |  March 25th, 2008 at 6:32 am #

    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.

    James Chase - Gravatar
  6. Danny  |  March 25th, 2008 at 10:23 am #

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

    Danny - Gravatar

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>