简体   繁体   中英

Error while using sudo command

I was trying to install mysql on my Linux Mint 15, and I got the following error:

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

First, log in as root or a user with root permissions

Use a text editor like Vim to open it up with

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.

I believe this might be the answer to your problem 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 ??

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.

This work for me

In the terminal enter as root like this

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

Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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