编辑/etc/sudoers文件。也就是输入命令" vim /etc/sudoers",进入编辑模式,找到这一 行:" root ALL=(ALL) ALL"在起下面添加" xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存退出。