7

I'm an Ubuntu newbie I just installed 10.10 and I don't know what I did but now to perform actions that required sudo privileges (open synaptic, mount device, run apt-get install, etc) the OS won't let me saying I don't have enough privileges, for example when I try to sudo apt-get install it tells me:

myusername is not in the sudoers file.  This incident will be reported.

So I have to log in as su to do any on these things. I didn't have to do this before, I just used the regular root privileges but as I said I must have changed something unintentionally.

Can anyone help me?

2
  • Can you post the output of the id command (i.e. groups you are a member of)?
    – arrange
    Mar 24, 2011 at 19:23
  • I tried but it said sudo: /etc/sudoers is mode 0644, should be 0440 sudo: no valid sudoers sources found, quitting
    – user32310
    Nov 4, 2011 at 20:01

1 Answer 1

6

The standard setup requires all sudoers to be in the admin group. You either dropped out of that group or are using an account that never had this group membership.

As root, add yourself to the admin group

addgroup myusername admin

And try again. If this didn't do the trick then something in your sudo setup is not as it should be. Maybe let us have a look at /etc/sudoers. I would expect there to be the last line:

%admin ALL=(ALL) ALL
3
  • Thanks DsSAR, adding myself as an admin fixed the issue, I guess I must have done something to drop myself out of the group since ubuntu auto-adds the first account as an admin I think. Mar 24, 2011 at 19:36
  • Yes it does; Don't mean to scare you but keep an eye out for more privilege weirdness. Make sure all accounts on your machine are properly password protected and only accounts that need to have admin access. You can check using 'grep admin /etc/group' which will list all users that are part of admin (and probably also lpadmin, but that's not relevant here)
    – DrSAR
    Mar 24, 2011 at 19:42
  • Thanks, it's a fresh ubuntu install so it just has me for now. Mar 24, 2011 at 19:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .