Identify whether the pcspkr kernel module is loaded, unload it to stop
immediate beeping, and blacklist it so it cannot be loaded again automatically.
Validate the change using CLI-only checks.
Your system keeps beeping on every alert. You have been asked to identify and
disable the pcspkr kernel module. Your goal is to stop the beeping
immediately and prevent the module from loading again in the future.
This is a classic “reduce noisy behavior” sysadmin task. Unloading removes the module now, while blacklisting prevents future auto-load events.
pcspkr is currently loaded./etc/modprobe.d.modprobe. It prevents
automatic loads triggered by hardware detection or dependency resolution.
lsmod
and handle safely before forcing changes.
pcspkr is loaded.
lsmod | grep pcspkr
This confirms whether the pcspkr module is currently loaded. If it
appears in output, the kernel has it active and it can trigger PC speaker beeps.
pcspkr 20480 0
sudo rmmod pcspkr
Unloading removes the module from the running kernel immediately. If something
depends on it (rare in practice), removal may fail, but for pcspkr
it typically succeeds.
echo 'blacklist pcspkr' | sudo tee /etc/modprobe.d/nobeep.conf
Blacklisting tells modprobe not to load this module automatically.
Placing it in /etc/modprobe.d makes it persistent across reboots.
grep pcspkr /etc/modprobe.d/nobeep.conf
This confirms your configuration file contains the blacklist rule. If the line is present, the persistent configuration is in place.
blacklist pcspkr
That means the module is not loaded right now. You can still blacklist it to prevent future loads, but there is nothing to unload.
Something has an active dependency. Confirm with lsmod | grep pcspkr
and check related input/beep packages or drivers. In most environments,
pcspkr is not required, but avoid forcing removal on a production host.
Blacklisting prevents auto-load behavior. An administrator can still load a blacklisted module manually unless additional policy is in place.
Confirm the file exists under /etc/modprobe.d and the line is correct.
Also search for other files that reference the module name:
grep -R pcspkr /etc/modprobe.d.
If you need to undo the blacklist for testing, remove the file and re-check:
sudo rm -f /etc/modprobe.d/nobeep.conf
and confirm with grep -R pcspkr /etc/modprobe.d.
pcspkr no longer appears in lsmod after removal, and your
blacklist file contains the expected line.
lsmod: Lists currently loaded kernel modules.grep: Filters output by matching patterns.rmmod <module>: Unloads a kernel module from the running system./etc/modprobe.d/*.conf: Persistent configuration for module load behavior.blacklist <module>: Prevents automatic loading of a module by modprobe.tee: Writes stdin to a file (useful with sudo for protected paths).