Post-installation tweaks for Debian bullseye

This post gives a few tweaks I like to apply to a freshly installed Debian system.

CPU microcode

It is important for modern CPUs to install the microcode. This can be easily done by installing the intel-microcode or amd-microcode packages, which are in the non-free repository. Add the contrib and non-free repositories to the /etc/apt/sources.list and install the microcode package. After the next boot you should see a log message at the beginning of your dmesg log:

microcode: microcode updated early to revision 0xba, date = 2017-04-09

Hard disk optimisations

Consider mounting the /tmp directory as a RAM file system. Temporary files are then kept in memory and not written to hard disk. This is a good idea if you have plenty of memory spare. But remember that files will be deleted during a reboot! To enable the RAM file system enable the tmp.mount service:

cp /usr/share/systemd/tmp.mount /etc/systemd/system/
sudo systemctl enable tmp.mount

If you are using a SSD or in a VM guest, consider enabling FS trimming to let the hard disk reclaim unused blocks:

systemctl enable fstrim.timer

Disable PC speaker

When working on the console the PC beeper can be quite a nuisance. The bell can be disabled in programs like Bash, vim, less etc., but this is tedious. A simpler way is to disable the beeper altogether by blacklisting the pcspkr module:

echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf