Sudo comes up with an error, cannot run anything as root

If you can login as root:

$ su root     #enter password
$ chmod 644 /usr/lib/sudo/sudoers.so
$ chown -R root /usr/lib/sudo

If not, you'll have to startup in recovery mode, get write permission on your disk, and change the mode of that file. https://wiki.ubuntu.com/RecoveryMode

$ mount -o remount,rw /
$ chmod 644 /usr/lib/sudo/sudoers.so

1st open your terminal then type and enter

pkexec su

it will log you in as a root user

now type (replace username with your PC's username):

chown -R username /usr/lib/

now open file explorer and goto /usr or type this in another terminal: nautilus /usr

now, right click on the lib folder and goto 'Permissions' tab.

From there change the access of 'Group' and 'Others' to- 'Access files'

now click on the button 'Change Permissions for Enclosed Files' now change the access of 'Group' and 'Others' to- 'Access files' or 'Read-only'.

now close that window and return to the terminal(the one with root user).

now type

chown -R root /usr/lib/

voila!

now you can use sudo again.