This is what happened:

I tried to enter any sudo command (e.g. sudo visudo) and entered Pi's default password(raspberry if you don't know) and this is what it came up with:

pi@(none) ~ $ sudo apt-get update sudo: unable to resolve host (none) [sudo] password for pi: Pi is not in the sudoers file. This incident will be reported.

  • What changes have you made to the groups or /etc/sudoers file? You should have a line like this at the end of your /etc/sudoers file pi ALL=(ALL) NOPASSWD: ALL if you look at the error message that is not what you have. Also, to avoid locking yourself out of the system (though it may already be to late for that) always edit the sudoers file wih visudo. You may need to mount the SD card in another computer to correct the problem. – Steve Robillard Jul 24 '16 at 8:31
  • Can you add the content for the user pi from /etc/sudoers to your question? The entry should look like pi ALL=(ALL) NOPASSWD:ALL. – ott-- Jul 24 '16 at 16:00
  • @ott-- he is unlikely to be able to do that because his sudo access is borked. – Steve Robillard Jul 24 '16 at 21:46
  • Is this because you don't have a Hostname assigned ? The error states unable to resolve host (none)... – KennetRunner Jul 27 '16 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.