In Ubuntu12.04, when sudoapt-getinstallXXX is used, the usernameisnotinthesudoersfile problem suddenly exists and I will check the username type. There are at least two methods to solve this problem: i. SystemSettings-& gt; UserAccounts-& gt; click Unlock-& gt; enter
In Ubuntu12.04, when sudo apt-get install XXX is used, the username is not in the sudoers file problem suddenly exists.
Then I checked the username type, which is a standard user instead of an administrator user.
There are at least two ways to solve this problem:
I. System Settings-> User Accounts-> click Unlock-> enter the root password-> change AccountType to Administrator (Administrator)-> restart
II.
Under the root user, change the/etc/sudoers permission to 640 (chmod 640/etc/sudoers)-> vim/etc/sudoers-> Find root ALL = (ALL: ALL) ALL-> Add
Username ALL = (ALL: ALL) ALL-> modify the/etc/sudoers permission to 440 (chmod 440/etc/sudoers)-> restart
There are two methods I know. If there are other methods, please leave a message.
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-06/118761.htm