Turning Off The System (hardware) Beep : Linux Tutorial

By | 2007/07/26

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!

39 thoughts on “Turning Off The System (hardware) Beep : Linux Tutorial

  1. 1052

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

  2. shermann

    Most easier is to set in ~/.inputrc

    set bell-style none

    Regards,

    \sh

  3. Luke Hoersten

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

  4. erik

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

  5. Athropos

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

  6. kh

    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.

  7. Pingback: Famous last words of Marius » From my RSS feedreader to the world — 28 July 2007

  8. Pingback: Peregrine

  9. Subbu

    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.

  10. Pingback: It tastes like burning : Blog Archive : links for 2007-09-07

  11. Cyde Weys

    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!

  12. lx

    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.

  13. Pingback: hubab » Turning Off The System (hardware) Beep : Linux Tutorial

  14. norwizzle

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

  15. Dré

    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.

  16. Nick

    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!

  17. Troy

    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.

  18. Herman D. HugeLoad IV

    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!!!

  19. Peter Schumacher

    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..

  20. Mimi

    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*!

  21. wbloos

    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

  22. Sreejesh

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

  23. punya

    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. Jabba

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

  25. Craigg

    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.

  26. Andy

    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".

  27. ananda

    toggle "play alert sound"

    !cheers!

  28. kiranjith

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

  29. Noctambulix

    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.

  30. Seul

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

Comments are closed.