Ubuntu – Issue in running sudo visudo command? visudo: /etc/sudoers busy ,try again later

16.04command linesudo

There is an issue when I try to run the command sudo visudo and the error was shown:

visudo: /etc/sudoers busy ,try again later

Best Answer

First find out which process is using /etc/sudoers file:

sudo lsof /etc/sudoers

from your outputs, seems it's another visudo instance:

visudo 9348 root 5uW REG 8,1 755 9699545 /etc/sudoers 

so, switch into root in case that something went worng:

sudo -i

then run:

kill -15 9348
ps --no-heading 9348 || kill -9 9348

open another terminal, run:

sudo visudo

make sure everything works fine, then you can log out from your root shell.