2
user@main-desktop:~$ sudo apt-get python-cheetah
[sudo] password for user: 
user is not in the sudoers file.  This incident will be reported.

So that is what I get when trying to install something while logged into my user account. It's prompting me for the user password.

How do I get it to prompt me for my admin account's password so that it will allow me to install something? I want to try and keep the user account seperate. I'm new to linux but it seems like adding a user account to the sudoers file defeats the purpose of having a user account.

dcvl
  • 123

3 Answers3

1
  • For individual commands to run as super-user, use:

    sudo -u your-admin-account sudo COMMAND [ARGS...]
    

    (replace your-admin-account with the name of your admin account)

  • To start a shell as your-admin-account use:

    su - your-admin-account
    

    In this shell you can use sudo with your admin account's password. When you don't need the admin shell any more close it using exit or Ctrl+D.

David Foerster
  • 36,890
  • 56
  • 97
  • 151
0

Use pkexec instead. pkexec prompts with a list of users who can authorize the action, if the current one can't:

user1@ica:~$ DISPLAY= pkexec bash
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/bin/bash' as the super user
Authenticating as: Muru (muru)
Password: 

I unset DISPLAY to show you the CLI prompt, but pkexec typically uses a graphical prompt if the GUI is available.

muru
  • 207,228
-1

The user that you are trying to install from named user has no sudo power which means he is not an admin on your system.

In order to install a package you should be a sudoer which means admin user.

So you can fix your problem by either use a sudoer user to install or change your account from normal user to admin user.

To change this account to sudo user you have to run this command using either root user or another sudo user

sudo usermod -a -G sudo user

sudo usermod -a -G sudo adm

But according to @muru advice not to use usermod -a -G this is another way to perform the same task

sudo adduser user sudo

sudo adduser user adm

Now the user named user is a sudoer

Maythux
  • 87,123