One day I want to update the
vim-enhanced on a Centos Linux 7 server.
I ran the command
sudo yum remove vim and I did not notice that
sudo will be removed together with
As a result,
sudo is removed. And there is no way for me to re-install it, since
sudo yum install sudo will not work.
I tried several solutions, but they did not work (I have no root password).
Finally I come to the solution: via the help of Docker.
Run the following command:
docker run -v /:/hostOS -i -t chrisfosterelli/rootplease
And you will get into the shell, with root access, and / is mounted. Cool. Then in this shell you can run
yum install sudo.
Everything is fine then.