Ubuntu – Accidentally deleted ‘sudo’


I accidentally deleted the /usr/bin/sudo file. How can I restore it?

I have found a thread on ubuntuforums, but it seems to be not solved.

Best Answer

The reason I write this instruction here is that I didn't find a step-by-step solution when I ran into the problem myself. I'm a Linux newbie myself, so feel free to edit this :)

These steps solved the problem for me:

Boot into recovery mode (press Esc or left Shift after BIOS splash) enter image description here

Select Drop to root shell prompt option enter image description here

Mount the file system in writable mode:

mount -o rw,remount /

Add the internet connection (I'm not sure if this works with Wi-Fi):

dhclient eth0

Now you have to purge the existing sudo package. It's protected against removal, so you have to set this environment variable:


Purge the sudo:

apt-get purge sudo

That command also purged the ubuntu-minimal package, so if we run

apt-get install ubuntu-minimal

this will restore both packages

Reboot the system:

Related Question