xx is not in the sudoers file

sudo visudo

在root ALL=(ALL)ALL行下添加XXX ALL=(ALL)ALL,XXX为你的用户名

例如:

# User privilege specification
root    ALL=(ALL:ALL) ALL
zhxia   ALL=(ALL:ALL) ALL
原文地址:https://www.cnblogs.com/xiazh/p/2641953.html