Home > Linux > Turning Off The System (hardware) Beep : Linux Tutorial

Turning Off The System (hardware) Beep : Linux Tutorial

I was reminded this week of something that I often show people but I have never actually written down in a post. This may be old news to some of you, but when has that stopped me in the past!?

Now I should preface this with a warning that my boss pointed out to me. He says “the system beeps for a reason–it’s trying to tell you something–you should leave it on.” Now that is out of the way I’ll go ahead with how to disable the PC Speaker, which removes the often annoying beeps. It should be mentioned that this should work on any distribution, and is not Ubuntu specific.

Removing the driver

The system speaker is controlled by a driver in the Linux kernel. This allows the pc speaker to beep at you for different reasons or at different events. If you remove the module which drives the speaker, the beeping goes away, as the machine no longer knows how to interface with that device.
This can be done manually with a command such as:

sudo modprobe -r pcspkr

or you can set it as a persistent change by adding the module to your system driver blacklist, available at:

/etc/modprobe.d/blacklist

simply append the line “blacklist pcspkr” for that driver to be disregarded at every boot.

If you’d like to manually re-insert the module use:

sudo modprobe pcspkr

Enjoy the quiet!

Categories: Linux Tags:
  1. 1052
    July 26th, 2007 at 04:16 | #1

    So the question is: what is this not the default? Who, on earth, can find the system beep pleasant nowadays?

  2. 1052
    July 26th, 2007 at 04:16 | #2

    s/what/why/

  3. July 26th, 2007 at 05:55 | #3

    Most easier is to set in ~/.inputrc

    set bell-style none

    Regards,

    \sh

  4. July 26th, 2007 at 07:02 | #4

    Like shermann said, and easier and non-root required way would be to add
    setx -b
    to your ~/.bashrc

  5. July 26th, 2007 at 08:26 | #5

    This would have been useful at UbuntuLive. Did anyone else notice all the system beeps from people taking notes in Vim?

  6. Athropos
    July 26th, 2007 at 10:29 | #6

    In vim, you simply have to “set visualbell”.

  7. kh
    July 26th, 2007 at 11:11 | #7

    The system beeps you (may) get at power-on are important, as the number of them identify a certain hardware problem.

    Within the OS, they’re just annoying and unnecessary.

  8. Subbu
    September 7th, 2007 at 09:17 | #8

    If you have compiz running, you could replace PC Speaker with Visual Bell. So you really don’t miss the alert.

    This is available in the general settings option in the compiz settings manager.

  9. October 9th, 2007 at 14:27 | #9

    Thanks for the advice. I read some bad advice on another blog that said there was no universal way to disable the system bell, so I went around figuring out how to disable it in a bunch of different applications. And then of course I was always running into applications that I hadn’t turned it off in yet. Turns out there is a way to disable the system bell globally – thanks so much!

  10. lx
    October 15th, 2007 at 01:43 | #10

    try
    xset -b
    in ~/.bashrc

    Or change the frequency of the beep (in shell)
    setterm -blength 0

    the number is the frequency, so ’0′ turns it off.

  11. November 5th, 2007 at 14:05 | #11

    Thank you, this did the trick for fedora on vmware.

  12. norwizzle
    December 1st, 2007 at 00:55 | #12

    THANK YOU! I came close to prying my laptop open and hammering in that motherboard speaker.

  13. Dré
    December 31st, 2007 at 04:48 | #13

    I would like to disable the system bell when I use the ‘shutdown’ command. (I would like to keep the driver loaded…) Because the bell rings every minute. It seems, however, that the proposed solutions ( putting stuff in .bashrc and .inputrc ) don’t work when using a sudo-command. I looked at the source of shutdown but I could’n figure out where the bell is generated. Is there a solution?
    Thanks.

  14. Nick
    June 4th, 2008 at 16:38 | #14

    I kind of like the system speaker. It almost never rings for me, and you can make a simple script to have it ring at random times to piss off people. I bet there’s some way of playing music through it too (or something like that). In fact, I can’t figure out how to _enable_ the system beeps on my Gentoo system!

  15. Troy
    October 23rd, 2008 at 22:25 | #15

    My laptop doesn’t POST beep and GoboLinux doesn’t appear to even HAVE the pcspkr module.

    If I can’t get it to STFU, I might just open my laptop and hack off the wires.

  16. October 26th, 2008 at 06:32 | #16

    There are a bunch of ways to accomplish the goal, but this is by far the simplest, most practical, and takes the least time.

    Excellent – a huge thanks for the tip. I’d completely forgotten how to do this until I literally “fell over” your post via our perpetual friend Google.

    ACE! Thanks much!!!

  17. Peter Schumacher
    November 20th, 2008 at 18:41 | #17

    Under Ibex, the pc speaker module is not loaded but it still makes the annoying beep… If you’re using Compiz, the easiest way is to disable is using Compiz manager under ‘general’. Changing the preference under system/sound does not work, apparently Compiz overrules this. Thanks to ‘Subbu’ for the tip..

  18. Mimi
    November 24th, 2008 at 20:24 | #18

    My boyfriend is such a light sleeper.
    He’s on the bedroom, and I’m on the kitchen, and he wakes up everytime the computer beeps.

    And I almost drop what I have on my hand, when I hear that beep.

    But it sure wakes me up when I’m browsing source-code, and I’m getting sleepy… *BEEP*!

  19. Casper
    January 4th, 2009 at 09:58 | #19

    Thank you. :)

  20. wbloos
    January 8th, 2009 at 01:32 | #20

    Hi,

    I use Ubuntu 8.10 (Intrepid Ibex), and the above commands didn’t work for me. I don’t want the Compiz effect either, it’s almost even more annoying.

    I found the toggle:
    Preferences | Sounds | on the “sounds” tab: toggle off “play alert sound”

    cheers

  21. AJ – ECE
    January 16th, 2009 at 14:14 | #21

    THANK YOU !!

  22. Sreejesh
    January 26th, 2009 at 00:06 | #22

    Hi,
    It works fine for me on ubuntu 9.04 jaunty.
    Thanks for the help.

  23. punya
    February 8th, 2009 at 12:11 | #23

    It sounds great to turn off speaker to turn off shutdown and backspace sounds. But it ‘s very idiot to turn off speaker for all purposes. I wonder whether above commands turn off pc speaker for all beeps. If yes, it’s not very wise.

  24. nielsos
    March 5th, 2009 at 04:49 | #24

    SILENCE! thanks!

  25. Jabba
    April 3rd, 2009 at 19:28 | #25

    Thanks man! That stupid shutdown beep was driving me crazy.

  26. Craigg
    May 6th, 2009 at 10:11 | #26

    thx a lot for covering this up. Sitting in an open office with 10 people around you using Ubuntu with enabled internal speakers is quite a pain in the butt. Told everybody to do these steps and now it's silence! Thank you again.

  27. erik
    July 2nd, 2009 at 21:16 | #27

    thank you so much!

  28. Andy
    July 8th, 2009 at 20:47 | #28

    IN Ubuntu 9.04:
    System –> Preferences –> Sounds –> Sound tab –> Visual Alert —> Window
    So you don't miss the message after you follow everyone else's "how to disable".

  29. ananda
    August 7th, 2009 at 09:28 | #29

    toggle "play alert sound"

    !cheers!

  30. September 20th, 2009 at 08:53 | #30

    edit /etc/inputrc
    ———————
    set bell-style none
    ————-

  31. Noctambulix
    September 22nd, 2009 at 11:52 | #31

    A much less intrusive way (not sure whether it removes the shutdown beeps) is to lower the volume for the pc speaker in the control volume, assuming your environment has one. This works in ubuntu 9.

  32. Achmed
    September 25th, 2009 at 14:38 | #32

    “Silence! I kill you!”

    =)

  33. wei
    October 26th, 2009 at 14:08 | #33

    thanks you ! I made it

  34. Seul
    June 11th, 2010 at 07:25 | #34

    I tried everything (ubuntu 10.04), in the end it was the Bios

  35. September 28th, 2010 at 07:59 | #35

    Check this website for an updated solution: http://www.thinkwiki.org/wiki/How_to_disable_the_pc_speaker_(beep!)
    In my case (Ubuntu 10.04) the faulty module was snd_pcsp and not pcspkr

  1. July 28th, 2007 at 00:46 | #1
  2. July 28th, 2007 at 02:35 | #2
  3. September 7th, 2007 at 15:17 | #3
  4. October 22nd, 2007 at 08:58 | #4