How to repair Ubuntu after messing up permissions on critical directories?

Solution 1:

As mentioned in the comments, you will still run into issues so it would be easiest to reinstall.

However, for this particular problem, you can return the ownership to man:man by running the following commands:

chown -R man:man /var/cache/man/
chown -R man:man /var/cache/man/*