No longer a sudoer, after doing do-release-upgrade

September 9, 2014 835 views


my network connection was lost while I was making do-release-upgrade (Ubuntu installation). When I logged in once again, I am no longer in the sudoers file. What can I do in this circumstances.

2 Answers

Hi Aphollo,

In that kind of circumstances, you should check all processus related to the do-release-upgrade processus. I am not sure at 100%, but I remember that the do-release-upgrade command was running inside a screen, not modifying the system until it's been executed successfully.

So, rebooting the VM should abort the do-release-upgrade, as it will proceed in a rollback operation. You may also try to attach the screen if the user running it is the user you are using is part of an the same UNIX group or the user itself.

To avoid that kind of problem, I advice you to add an SSH key in your root account, allowing you to log as 'root' using ssh identication, which does not need you to be in the sudoers. The DigitalOcean admin panels proposes this solution, and it can be a good way to get out of that situation.

The other solution you can use is to include your users in the 'wheel group', and modify the PAM libs to allow you using the 'su' command if you are part of the wheel UNIX group. Here is the way you can do it, running those commands as root :

groupadd wheel
adduser 'your_user' wheel
echo "auth      sufficient  pam_wheel.so trust use_uid" >> /etc/pam.d/su

Then you just type 'su' in the shell, and you're root ;)

I hope this information could help you to solve this issue,

Best regards,


@rustx thanks! I managed to fix the problem by logging in as root via DO console and then issuing dpkg with proper options to finish the installation. Now everything works (almost) fine.

Have another answer? Share your knowledge.