• 周六. 7 月 27th, 2024

    Ubuntu 22.04 xxx 不在sudoers文件中。此事将被报告

    root

    12 月 4, 2022 #linux

    在更换apt软件源的基础上,执行apt-get update. 出现如下图报错。

    我们编辑 /etc/sudoers配置文件,添加指定的用户,使其有sudo的权限。

    su -
    chmod u+w /etc/sudoers
    vim /etc/sudoers

    找到root ALL=(ALL:ALL)ALL语句以下添加一行

    您的用户名 ALL=(ALL:ALL)ALL

    保存退出

    我们再次执行sudo apt-get update。发现不报错了

    root