In the Linux system, to execute the sudo command, you need to configure the /etc/sudoers file accordingly.
It is generally recommended to use the visudo command to operate the file. Note: Do not use vi directly. Using vi directly will not perform relevant verification on the newly added file, which may cause the file to not be parsed correctly. Eventually, the sudo command cannot be used, nor can it be A series of problems such as switching to use the root user.
The general error message is as follows:
sudo: parse error in /etc/sudoers near line 24 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin
If an error occurs, the following solutions are executed:
pkexec visudo
Enter the file editing, directly modify the wrong place just now, save and exit, and return to normal.
The premise of the above method is that you want to install pkexec. If it is not installed, you can use the following method.