Tombuntu

Disable your Internal Speaker's Beep in Linux

Linux has the annoying habit of beeping too much. And not using the normal speakers, it beeps with the speaker inside your PC. This can often be very loud. My Ubuntu installation beeps on the terminal, when it shuts down, and Firefox beeps when “Find in This Page…” fails. By blacklisting the module that controls the speaker, the beep can be silenced permanently.

[update] Mackenzie has pointed out in the comments that there’s an easier way! Open System->Preferences->Sound and select the System Beep tab. Uncheck the Enable system beep box. This will work only for your user and only inside the GNOME desktop, which will be fine for most people. Use the Visual system beep option and Compiz will nicely flash your windows or screen.

Open the file /etc/modprobe.d/blacklist as root in a text editor:

nano /etc/modprobe.d/blacklist

Add this line to the end of the file:

blacklist pcspkr

The next time Linux boots up pcspkr will be blocked from loading and you will no longer hear the beep. Peace and quiet at last!

But if you only need a temporary solution to disable the beep, just run this command (as root): [update: “rmmod” is being deprecated, use “modprobe -r” instead.]

rmmod pcspkr
modprobe -r pcspkr

That will disable the speaker until the next reboot. If you want it on again run this (as root):

modprobe pcspkr

Archived Comments

Christer Edwards

rmmod is actually being deprecated. The suggested way to remove a module is ‘modprobe -r module’. Pretty common to still mention rmmod, but just a heads up.

Tom

Thanks Christer, I updated the post.

Mackenzie

Too much command line. System -> Preferences -> Sound -> System Beep -> Uncheck “Enable System Beep”

McPop

There can never be too much command line.

Anonymous

Thanks a lot for this.

Anonymous

There’s another way of accomplishing this task. Run the command `xset -b` to turn of the system beeping. Run the command `xset b` to turn it on again.

Anonymous

You just made my day!! I’ve been pestered by that stupid system beep and didn’t think I could disable. It’s awakened my husband more than once… bad for our relationship!

Thanks again! :)

Tim

Hey thanks for this! My wife plays muds using kildclient and whenever she backspaces too many times on the input line it beeps the pc speaker. It gets very annoying for both of us :) Using slackware all I’ve ever had to do to turn off the speaker beep (it’s annoying in bash too) was edit /etc/inputrc and change the line near the top to:
set bell-style none

Which always worked fine for me, but her mud client still kept on beeping after I changed it on her computer (she uses kubuntu). This did the trick nicely.

I’d never thought of just unloading or blacklisting the kernel module. And a quick check shows that in my newest install of slack 12.1 the module is also blacklisted to keep the beeps out. Thanks again :)

william

It works on Kubuntu 6.06 LTS. Thanks a lot :)

Anonymous

thanks that was a very useful simple command

Phil

Here’s what I did:
$ sudo vi /etc/inputrc

Remove the # in front of “set bell-style visible”

Now you get a flash in your terminal window instead of a bell, and that’s for all users.

Neike Taika-Tessaro

Yesssssss.

You’re now responsible for my current state of bliss.

Pada

My Ubuntu 9.04 doesn’t have a System Beep tab. To disable the Internal PC Speaker I had to go to the Sounds tab and uncheck the Play alert sound.

Dan

Hi,
and what to do when my laptop has no PC speaker and terrible beep I hear from audio output (=loudspeakers)? I havent pcspkr module loaded, so rmmod cant help me. I’ve tried “setterm -blength 0” but it works only in command line. Other programs like kopete, gvim … beeps still. xset -b doesnt work. My system OpenSuse 11.0+XFCE 4

Ubuntu 9.04

WARNING: All config files need .conf: /etc/modprobe.d/blacklist, it will be ignored in a future release.

Victor

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

Thomas

Valuable post.

Debian squeeze apparently needs a second blacklist line:

blacklist pcspkr
blacklist snd_pcsp

Respond via email