LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-17-2018, 07:46 PM   #1
santiago ferreiro
LQ Newbie
 
Registered: Oct 2018
Posts: 2

Rep: Reputation: Disabled
Exclamation problem when trying to install sudo


I was trying to install sudo on my VM and when i used the code
Code:
apt install sudo
the output was this:
E: Sub-process /usr/bin/dpkg returned an error code (2), can someone tell me how to fix this?
I was using debian 9 and im already root
 
Old 10-17-2018, 07:51 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
sudo is already installed BY DEFAULT and should be configured by default ( at time of the OS install

or you have set a "ROOT" password at time of install and are not using sudo but using " su - "
 
Old 10-17-2018, 07:56 PM   #3
santiago ferreiro
LQ Newbie
 
Registered: Oct 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
sudo is already installed BY DEFAULT and should be configured by default ( at time of the OS install

or you have set a "ROOT" password at time of install and are not using sudo but using " su - "
I already checked and it is not installed I don't know why, I'm a high school student and i'm doing this for a project, i'm not very experienced with Linux









//sorry for the bad English it is not my native language //
 
Old 10-17-2018, 08:19 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
then become "root" in a terminal and do a apt search
Code:
su -

---- type in the ROOT password ----

apt search sudo
if listed install it AS the ROOT user

but on debian sudo is part of the default base install and should be installed
( maby your user name is not in the sudoers list )
 
Old 10-17-2018, 08:55 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,386
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
Generally, sudo is in the base install of almost everything Linux.

Try this, as root:

Code:
$ updatedb
$ whereis sudo
Also, Debian does not configure sudo by default. It expects you to use su to assume root privileges. See man su for details.

The creepy sudo fetish is a *buntu thing.

Last edited by frankbell; 10-17-2018 at 08:59 PM.
 
Old 10-19-2018, 03:27 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by santiago ferreiro View Post
I was trying to install sudo on my VM and when i used the code
Code:
apt install sudo
the output was this:
E: Sub-process /usr/bin/dpkg returned an error code (2), can someone tell me how to fix this?
I was using debian 9 and im already root
is that all the output you get?

please show us the complete output.

how did you install debian?
did you do something to it subsequently?
 
Old 10-19-2018, 09:16 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,386
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
In my experience, only Ubuntu and its derivatives configure sudo by default. Every other distro I've used, including Debian, expects you to configure a root password at either install or first boot and use su to perform administrative tasks.

Debian includes sudo by default, but does not configure it. I checked my Debian box just to be certain. This, by the way, is the common practice outside of the *buntuverse.

Last edited by frankbell; 10-19-2018 at 09:22 PM.
 
Old 10-20-2018, 07:50 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
As far as I can remember, Debian has a "sudo" group, which is set in sudoers to have full sudo rights. If you add yourself to this group, you should be able to use sudo.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
install sudo apt-get install synaptic problem help me dear :( zeeshanayub Linux - Newbie 49 10-23-2014 02:55 AM
help :(install sudo apt-get install synaptic problem help me dear :( help me help me zeeshanayub Linux - Newbie 3 10-21-2014 07:02 PM
Problem with SUDO : sudo: pam_authenticate: Module is unknown cristoph_ Linux - Software 2 03-02-2009 07:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration