简体   繁体   English

使用sudo命令时出错

[英]Error while using sudo command

I was trying to install mysql on my Linux Mint 15, and I got the following error: 我试图在我的Linux Mint 15上安装mysql,我收到以下错误:

paul@paul-Ideapad-Z570 ~/un_test $ sudo apt-get install mysql-client-core-5.5
[sudo] password for paul: 
Sorry, user paul is not allowed to execute '/usr/bin/apt-get install mysql-client-   core-5.5' as root on paul-Ideapad-Z570.

Any help would be appreciated. 任何帮助,将不胜感激。 Thanks! 谢谢!

Make sure your user is in the /etc/sudoers file 确保您的用户位于/ etc / sudoers文件中

First, log in as root or a user with root permissions 首先,以root身份或具有root权限的用户身份登录

Use a text editor like Vim to open it up with 使用像Vim这样的文本编辑器打开它

sudo vim /etc/sudoers

you will see a line like this in the file: 你会在文件中看到这样的一行:

#Default rule for root.
root    ALL=(ALL) ALL

Insert your user under the root line to make it look like this 在根行下插入您的用户,使其看起来像这样

#Default rule for root.
root    ALL=(ALL) ALL
youruser ALL=(ALL) ALL

save the file. 保存文件。 After this, log in as your user and you can use sudo. 在此之后,以您的用户身份登录,您可以使用sudo。

I believe this might be the answer to your problem https://wiki.debian.org/sudo 我相信这可能是你的问题的答案https://wiki.debian.org/sudo

Specifically the second sentence of the second paragraph. 特别是第二段的第二句。 Follow the steps there and see if that helps. 按照那里的步骤,看看是否有帮助。

did you try doing sudo -u [user with permission to install] apt-get install mysql-client-core-5.5 ?? 你尝试过做sudo -u [user with permission to install] apt-get install mysql-client-core-5.5 ??

I think the issue comes down to permissions of the user you are logged in as, you might have to sudo in as root or another user with permissions to do the install. 我认为问题归结为您登录的用户的权限,您可能必须以root身份或具有执行安装权限的其他用户进行sudo。

This work for me 这对我有用

In the terminal enter as root like this 在终端中以root身份输入

su root

type your password below and then once you've logged in 在下面输入您的密码,然后在您登录后输入

adduser <yourusername> sudo

Then you should be able to use sudo again 然后你应该能够再次使用sudo

Hope it helps! 希望能帮助到你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM