You may use a laptop in library,or work too late with your computer,or leave your computer working by a shutdown command, and you may worry about that it may makes a noise when shutdown.I will tell you how to deal with it easily in the tutorial.

First,you need to open up a terminal window and execute following code to edit  /etc/modprobe.d/blacklist.conf

sudo gedit /etc/modprobe.d/blacklist.conf

then add blacklist pcspkr at the end of the file as a new line,close and save it.

snapshot65

restart you computer and done.