Turn off error sound on Ubuntu 18.04
In order to turn off Ubuntu error sound in Ubuntu 18.04 you need to go Setting > Sound > Sound Effects > Alert Volume > Off.
If you just want to turn off on terminal in Ubuntu 18.04, open Terminal > Edit > Preference then choose your terminal profile and uncheck Terminal Bell
Add the following line to the bottom of your ~/.bashrc
file:
bind 'set bell-style none'
New terminals will have no error sound.