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 **
- Check if you have the pcspkr module loaded.
[root@nosebleed ~]# lsmod | grep pcspkr
pcspkr 7105 0
- Remove the module. lsmod will return nothing if the module was removed.
[root@nosebleed ~]# rmmod pcspkr
[root@nosebleed ~]# lsmod | grep pcspkr
- 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 **
- 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
- 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.