![如何在没有 sudo 的情况下运行命令来安装软件?](https://linux22.com/image/1088128/%E5%A6%82%E4%BD%95%E5%9C%A8%E6%B2%A1%E6%9C%89%20sudo%20%E7%9A%84%E6%83%85%E5%86%B5%E4%B8%8B%E8%BF%90%E8%A1%8C%E5%91%BD%E4%BB%A4%E6%9D%A5%E5%AE%89%E8%A3%85%E8%BD%AF%E4%BB%B6%EF%BC%9F.png)
我正在尝试使用命令安装 Skype
dpkg -i skype-ubuntu-precise_4.3.0.37-1_i386.deb
它给了我一个错误:
dpkg: error: requested operation requires superuser privilege
如何为当前用户分配超级用户权限,以便我可以在不使用 sudo 的情况下运行命令?
这是我的/etc/sudoers
文件:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
当我运行以下命令时
sudo adduser ehsaan sudo
它给出了一个错误:
The user `ehsaan' is already a member of `sudo'.
答案1
除非您以 root 身份登录,否则需要使用 sudo 才能编辑系统文件。据我所知,这是不可能的。