sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0

Ownership of at least one of your important system files is wrong. That's a bad thing; if this has happened to many system files (perhaps you ran a big sudo chown command with the -R flag at some point?), it could cause a number of other system errors and instabilities. So if you recently installed Ubuntu, you might want to reinstall as Adam Heathcote suggests.

But you do not have to reinstall to fix this problem. Instead, just fix the ownership on that file. If you get errors about other files after that, you can fix them too (though you might have to tell us what the error messages are, so we can tell you how to fix them also).

sudo does not work, but using sudo is one of two ways for administrators to perform actions as root on Ubuntu. The other is Polkit (which used to be called PolicyKit).

Run this command, which uses Polkit (via pkexec) to change the ownership of /usr/lib/sudo/sudoers.so back to root (i.e., uid 0):

pkexec chown root /usr/lib/sudo/sudoers.so

Then try using sudo again. You can run something trivial like sudo ls, and see if you get an error message.

Finally, I recommend running history to reveal all the commands you've run. Hopefully that will list all the commands you've run that have changed permissions. Assuming sudo now works, I recommend posting a new question including the output of history, to get help undoing all the file ownership and permissions changes you've done.

If pkexec doesn't work either...

You tried pkexec and it didn't work. Since neither sudo nor Polkit is working to allow you to perform actions as root, you'll have to boot into recovery mode and get a root shell. To do this, hold down Shift while booting up your computer, to ensure you get a visible GRUB boot menu. Select an entry that contains the words recovery mode (generally, you should select the one closest to the top that has those words). Then you'll get a menu where you have a number of options--select the option to drop to a root shell.

Detailed instructions on accessing a root shell in recovery mode are here:

  • How do I boot into a root shell?

Once you have a root shell, run:

chown root /usr/lib/sudo/sudoers.so

If you get an error about the file or filesystem not being modifiable, then remount it readwrite:

mount -rw -o remount /

(Source for the idea of remounting and how to do it: this mostly unrelated answer.)

Then after running that mount command, run the above chown command again and see if it works.

Once you're done in recovery mode you can reboot by running:

reboot

sudo should then work, or at least give some other error.

Finally, please note that given the errors you showed, it's likely that many files now have the wrong ownership or permissions. It would be ideal if you could figure out which files you modified in this way. For example, if you could figure out that it was all files in a couple specific folders, then it might be possible to correct the complete extent of the recent problems you've been having.

Reinstalling is definitely an option, but especially if all you changed was ownership (and not permissions, which are somewhat harder to reconstruct as they vary more), it should be possible to simply set the permissions back recursively to their original owners (probably usually root) and reverse the damage entirely.

Getting sudo working again is a first step. Hopefully the above technique will enable you to do that.