This is the easy fix for errors received while trying to 'sudo'.
Errors received are 'Unable to resolve hostname' or 'readonly filesystem'.
This error is caused by a filesystem corruption, usually experienced when operating from an external harddrive on the Raspberry Pi,
the fix works because the operating system is already read only. Normally you would boot into Recovery or Single User Mode to perform
this fix, but you can easily do this from an SSH session.
Replace 'sda1' with your filesystem root partition dev path.
sudo fsck.ext4 -f /dev/sda1
BRANTFORDPC.COM | Serving Brantford & Brant County, Ontario Since 2007