On your next OS reinstall, perhaps consider using an atomic distro. They’re WAY harder to break in this fashion - primarily because you can just roll them back to the previous known-good state.
Edit: genuinely curious what the downvotes are for - I thought atomics were quite popular here?