Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 ?

SOLVED!

share|improve this question
    
Have a look at our answer to this question - it should help. askubuntu.com/questions/161074/… –  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. –  Jacob Johan Edwards 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
add comment

marked as duplicate by Takkat, jokerdino, Jacob Johan Edwards, 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.

1 Answer

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
1  
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
add comment

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