如何在没有 sudo 的情况下运行命令来安装软件?

如何在没有 sudo 的情况下运行命令来安装软件?

我正在尝试使用命令安装 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 才能编辑系统文件。据我所知,这是不可能的。

相关内容