problem when trying to install sudo

If none of the more specific forums is the right place to ask

problem when trying to install sudo

Postby santiago ferreiro » 2018-10-17 23:32

I was trying to install sudo on my VM and when i used the code
Code: Select all
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?
santiago ferreiro
 
Posts: 3
Joined: 2018-10-17 23:22

Re: problem when trying to install sudo

Postby GarryRicketson » 2018-10-17 23:42

You need to be root to install packages, maybe try:
Code: Select all
su - apt install sudo

Also which version of Debian might be relevant.
Last edited by GarryRicketson on 2018-10-17 23:48, edited 1 time in total.
User avatar
GarryRicketson
 
Posts: 5162
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: problem when trying to install sudo

Postby santiago ferreiro » 2018-10-17 23:45

GarryRicketson wrote:You need to be root to install packages, maybe try:
Code: Select all
su ~ apt install sudo

Also which version of Debian might be relevent.

I'm already root and if im not wrong its debian 9
santiago ferreiro
 
Posts: 3
Joined: 2018-10-17 23:22

Re: problem when trying to install sudo

Postby GarryRicketson » 2018-10-17 23:58

Ok, well, I am not sure then, also, did you use the - after su ?
and I had made a typo, in my post, I edited it,
Code: Select all
su -
instead of ~ but anyway that is a issue on Debian testing, (buster) and I don't think it effects Debian 9, (Stretch)
User avatar
GarryRicketson
 
Posts: 5162
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: problem when trying to install sudo

Postby santiago ferreiro » 2018-10-18 00:02

GarryRicketson wrote:Ok, well, I am not sure then, also, did you use the - after su ?
and I had made a typo, in my post, I edited it,
Code: Select all
su -
instead of ~ but anyway that is a issue on Debian testing, (buster) and I don't think it effects Debian 9, (Stretch)

I just tried with the " - " and it still doesn't work, if you have any other ideas i would be glad to hear them :D, thanks anyway
santiago ferreiro
 
Posts: 3
Joined: 2018-10-17 23:22

Re: problem when trying to install sudo

Postby GarryRicketson » 2018-10-18 01:30

What if you try ? :
Code: Select all
apt clean

(as root)
and after that:
Code: Select all
apt update

(as root)
and then try to install the package again, show us what any more errors say, if it does not work.
User avatar
GarryRicketson
 
Posts: 5162
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: problem when trying to install sudo

Postby Head_on_a_Stick » 2018-10-18 05:10

santiago ferreiro wrote:can someone tell me how to fix this?

I would enter the error message you have quoted into a search engine, this is the top result and shows how to fix your problem:

https://askubuntu.com/questions/591855/ ... ror-code-2

See also viewtopic.php?f=30&t=47078
I suffer from depression and may lash out occasionally, try not to take it personally.
User avatar
Head_on_a_Stick
 
Posts: 8170
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: problem when trying to install sudo

Postby debiman » 2018-10-21 14:06

santiago ferreiro wrote:I was trying to install sudo on my VM and when i used the code
Code: Select all
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?

is that the complete output you're getting?
User avatar
debiman
 
Posts: 3017
Joined: 2013-03-12 07:18


Return to General Questions

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable