Gandi Wiki


You are on a question's page

Using Linux
answered

Answer "apt-get does not work", by Eric B.

I found the answer to my own question, after two, err actually three days of wanderings. The symptom

sudo apt-get -s install nano

displays nothing did not mean that apt-get was broken, but that sudo was broken.

Strangely enough, there are two reasons for that: the admin group is not part of sudoers anymore (cause one line is missing at the end of /etc/sudoers) and I am not in the admin group anymore (which can be seen in /etc/group.

If you believe http://www.psychocats.net/ubuntu/fixsudo: "The /etc/sudoers file should look the same for every Ubuntu user who hasn't fiddled with it" but mine does not look like this, and I certainly did not fiddle with it, whatever that means.

So if you continue reading the post in the above link, you see the solution to repare sudo: switch to root using su (that works with the same password), then add yourself to the admin group

adduser yourname admin

then edit the sudoers file (for some reason you have to use the visudo app for that)

visudo

then put back the following lines at the end of the file:

# Members of the admin group may gain root priviledges

%admin ALL=(ALL) ALL

Follow-up, by Torsten R.

On a fresh Ubuntu 10.04 install, I had a similar problem (sudo doesn't work, and su to root is something one really doesn't want to do everyday …). There is a group 'sudo' though, which is the one that is referenced in the sudoers file, too! All members of the sudo group can sudo …

So simple solution:

su
adduser //yourusername// sudo

HTH :)

Follow-up, by Steve R.

Thanks Torsten, just the solution I was looking for :)

Last modified: 31 Dec 2011 at 13:11 by Steve R.