I received the dreaded
<username> is not in the sudoers file. This incident will be reported error. Somehow my user was removed from
This is how I fixed it.
- Reboot your computer and when you see the prompt to hit
<esc>for the boot menu do it.
- Press the number which represents your boot drive (usually 1)
- You will be taken to a Grub menu, highlight the entry for PureOS and press
- Find the line that starts with
linuxand somewhere where it says
ro quiet, add
singlein there so that it looks like
ro single quietand at the end of that line add
init=/bin/bash(these changes will not persist)
Ctrl-Xto boot into single user mode.
- You will be at a bash prompt but the filesystem is read only so remount it read-write with:
mount -o remount,rw /
visudoto edit /etc/sudoers and add this entry:
<username> ALL=(ALL:ALL) ALL
- Reboot your computer and sudo will have been restored.