Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

Possible Duplicate:
How do I reset a lost administrative password?
I unexpetedly deleted administrator account and the other accounts are asking root password

Cannot install anything as no longer a member of sudo. Have tried recovery but get an error. :( Specifically "gpasswd: cannot lock /etc/group; try again later." unmount / remount is that useful ?


share|improve this question

marked as duplicate by Takkat, jokerdino, Jjed, Tom Brossman, Mitch Sep 30 '12 at 16:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Have a look at our answer to this question - it should help.… – Fernhill Linux Project Sep 30 '12 at 12:42
Thanks @FernhillLinuxProject Spot on remount code was exactly what I needed. (I guessed well :) impressed at speed of response solved in 5 mins amazing :) – Enio Sep 30 '12 at 13:16
Glad to help & thanks for the feedback. :o) – Fernhill Linux Project Sep 30 '12 at 14:22
@Enio Please do not post answers in the comment section, but instead with the "Your answer" textbox. Also, there is no need to reproduce the answer here. This question will soon be closed as a duplicate, thanks. – Jjed Sep 30 '12 at 15:13
@JacobJohanEdwards Answer was locked at the time for about 6 hours. So put Answer is comment in case someone else had a similar problem and my solution was slightly different to those linked. – Enio Sep 30 '12 at 21:23

Boot a live CD or USB. From there mount your installed root directory and edit a file /etc/sudoers.d/whatever. Add the following line:

yourusername ALL=(ALL:ALL) ALL

Then you can use sudo useradd -G sudo from within the installed system to add yourself back to the sudo group. (You can then remove the file if you wish.)

share|improve this answer
Thanks Ferhill's solution was more efficient, was on the lines of what I was looking for, but thanks for replying. – Enio Sep 30 '12 at 12:52

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