Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Well, I don't know exactly how it happened. But, thing is if I issue a command which I need root priviliges an error message comes that says <user> does not have an entry in sudoers file

I used to work in terminal after issuing sudo bash

Sometime back I installed postgresql using apt-get. It does not start as it takes some temporary (or any other, I'm not sure) as /var/run which postgres user did not have permissions. Well, simply I could have changed that dir to /tmp (which ultimately I did), but before that I played with the things. One of them (I don't remember why) was I tried to add a <user> to postgres group.

Well, that day things went well, but next day (I think after a restart) that <user> could not execute commands with sudo.

Now, I need to install dblink for postgres which I believe needs sudo permissions. Is there anyway to restore sudo permissions to that <user>
Or atleast, is there anyway to install dblink for postgresql without needing sudo thing??

share|improve this question

migrated from May 21 '11 at 23:17

This question came from our site for professional and enthusiast programmers.

Ask Ubuntu! – Mehrdad May 21 '11 at 23:09
Please note that although @Mehrdad is correct, and AskUbuntu is a good site. Please do not cross-post there. – Wuffers May 21 '11 at 23:18

Start your unbuntu in maintenance mode. You'll be given root shell.

Issue a visudo command to edit the sudoers files.

Then verify you have

user     ALL=(ALL) ALL

line. Then reboot.

share|improve this answer
Thanks for the response. I thought ESC would help in starting ubuntu in maintenance mode. But ESC, DEL, F2 I tried all but did not work. How should I do it. – Mayank May 22 '11 at 9:38
This is an option in the GRUB. At startup you usually choose your system or the fallback one. You can use e to edit the line. Add single at the end validate and then b to boot. Look it up on google, there is plenty of tutorial for this. – M'vy May 22 '11 at 9:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.