This post refers to Ubuntu 18.04 but will be helpful for other ubuntu versions and linux distributions.
If you are like me a Ubuntu user and have done something that makes this error message appear in your prompt
USERNAME is not in the sudoers file. This incident will be reported.
then relax, there is a solution to this.
This might happen whenever you work on user permissions, overlook something about the commands you enter in your prompt, and end up loosing the ability to use the sudo power.
Result: things like this will not work anymore:
$ sudo apt install <some-package>
and you will get the error mentioned above.
So here is the solution:
- Restart your computer and click the correct key to access the Grub loader (this might be shift key. Maybe you have to access boot loader first, or you end up anyway on Grub loader every time you start your computer).
What you should see is something like this:
- Choose “Advanced Options” and click “Enter”
This will send you to the next screen looking a bit like this:
- This time, choose the “recovery mode” (the first one from the top usually)
The following screen should appear now:
Use the arrow and go to “root Drop to root shell prompt” and click “Enter” - You will see underneath this menu – in the black area – this:
“Press Enter for maintenance”
Click Enter - You are now in the root shell prompt
Write the following:
# mount -o rw,remount /
and then
# mount -o rw,remount / - Now exit the prompt by writing
# exitand choose from the menu “Resume normal boot”
You might experience the case that the boot process freezes. Wait a bit. If it won’t resume correctly, press the power button of your computer (unfortunately). Wait a moment and press again to restart. It should all work well.
Leave a Reply