Linux – Disable Beeping in the Terminal
Are you tired of hearing that annoying beep sound when using your terminal on Linux? Even if you’ve turned off the speaker, this irritating noise persists. Don’t worry; I’m here to guide you through the simple process of disabling it.
Open a terminal window and run the following commands:
sudo apt-get update
sudo apt-get install -y pcspkr-utils
sudo apt-get remove -y pcspkr
echo "blacklist pcspkr" >> /etc/modprobe.d/blacklistExplanation:
sudo apt-get update: Update the package list to ensure you’re using the latest version of the system.sudo apt-get install -y pcspkr-utils: Install thepcspkrutilities, which are required for disabling the beep sound.sudo apt-get remove -y pcspkr: Remove thepcspkrpackage, which is no longer needed.echo "blacklist pcspkr" >> /etc/modprobe.d/blacklist: Add a line to blacklist thepcspkrmodule in the/etc/modprobe.d/blacklistfile.
After executing these commands, restart your terminal or run source ~/.bashrc (for Bash) or source ~/.zshrc (for ZSH) to apply the changes. The beep sound should now be disabled.
To enable the terminal beep just edit the /etc/modprobe.d/blacklist and delete the line that have:
blacklist pcspkrThis will restore the pcspkr module and reinstate the beep sound.