I get the following error when running sudo visudo on my Ubuntu:
visudo: /etc/sudoers busy ,try again later
Had you already run visudo ? That error indicates that the file is already being edited. First stop the other process with:
killall visudo
Also run
visudo -c
to make sure that the sudoers file was not corrupted.
mifi@mifi-Aspire-E1-572 ~> killall visudo visudo(9348): Operation not permitted visudo: no process found mifi@mifi-Aspire-E1-572 ~> visudo -c visudo: unable to open /etc/sudoers: Permission denied mifi@mifi-Aspire-E1-572 ~> sudo visudo -c /etc/sudoers: parsed OK /etc/sudoers.d/README: parsed OK mifi@mifi-Aspire-E1-572 ~> sudo visudo visudo: /etc/sudoers busy, try again later Still stuck with the same error.
If the accepted answer not working for you, then you can try this:
List all processes that use sudo
ps -ef|grep sudo
then you should kill all process id that existed in the second columns, by using this command:
kill -9 YOUR_PROCESS_ID