Are there any risks or disadvantages to building software from source, compared to installing a package? Can it mess with my system in any way?
I usually avoid it because I’ve found it to be a faff and often doesn’t work anyway but in a couple of cases it has been necessary.


What are the security advantages?
There are flags to disable things, like pulseaudio or whatever, so its not even included in the binary. Which means its 100% safe against vulnerabilities in that piece of code since its not inside the binary at all.
You can disable functionality that you don’t use or want (code that is not used cannot be exploited).
You can enable hardware/kernel specific security mitigations.
You can know what source code corresponds to the generated binary.