sudo: command not found
I'm new to this. I'm trying to install apache2 on an Ubuntu 15.04 server.
Running as root.
But when giving the command:
$ sudo apt-get install apache2
-bash: sudo: command not found
Can anyone point me in the right direction? Thanks in advance.
EDIT:
root@dev:~# whoami
root
root@dev:~# apt-cache policy sudo
N: Unable to locate package sudo
root@dev:~# apt-get install sudo
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package sudo
root@dev:~# apt-cache policy sudo
N: Unable to locate package sudo
root@dev:~# sudo apt-get install apache2
-bash: sudo: command not found
root@dev:~# apt-get install apache2
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package apache2
EDIT:
Ran; apt-get update and then tried again. Worked!
apache2 sudo
|
show 7 more comments
I'm new to this. I'm trying to install apache2 on an Ubuntu 15.04 server.
Running as root.
But when giving the command:
$ sudo apt-get install apache2
-bash: sudo: command not found
Can anyone point me in the right direction? Thanks in advance.
EDIT:
root@dev:~# whoami
root
root@dev:~# apt-cache policy sudo
N: Unable to locate package sudo
root@dev:~# apt-get install sudo
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package sudo
root@dev:~# apt-cache policy sudo
N: Unable to locate package sudo
root@dev:~# sudo apt-get install apache2
-bash: sudo: command not found
root@dev:~# apt-get install apache2
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package apache2
EDIT:
Ran; apt-get update and then tried again. Worked!
apache2 sudo
Does su work instead of sudo?
– Raphael
Nov 8 '15 at 15:38
1
Are you running as root? Please edit your question and add the output ofwhoamiandapt-cache policy sudo.
– muru
Nov 8 '15 at 15:43
1
which sudoshows anything? If not please add results frommore /etc/lsb-release
– Rinzwind
Nov 8 '15 at 15:46
1
@Rinzwind - I have a question. OP says that he is running as root right? So, he can use apt-get install sudo to install it, can't he?
– Raphael
Nov 8 '15 at 15:54
@muru Yes, whoami outputs root. The other returns; N: Unable to locate package sudo. So I guess it isn't installed yet. Going to look into that now. As I said, I'm new to this.
– Hees1989
Nov 8 '15 at 15:54
|
show 7 more comments
I'm new to this. I'm trying to install apache2 on an Ubuntu 15.04 server.
Running as root.
But when giving the command:
$ sudo apt-get install apache2
-bash: sudo: command not found
Can anyone point me in the right direction? Thanks in advance.
EDIT:
root@dev:~# whoami
root
root@dev:~# apt-cache policy sudo
N: Unable to locate package sudo
root@dev:~# apt-get install sudo
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package sudo
root@dev:~# apt-cache policy sudo
N: Unable to locate package sudo
root@dev:~# sudo apt-get install apache2
-bash: sudo: command not found
root@dev:~# apt-get install apache2
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package apache2
EDIT:
Ran; apt-get update and then tried again. Worked!
apache2 sudo
I'm new to this. I'm trying to install apache2 on an Ubuntu 15.04 server.
Running as root.
But when giving the command:
$ sudo apt-get install apache2
-bash: sudo: command not found
Can anyone point me in the right direction? Thanks in advance.
EDIT:
root@dev:~# whoami
root
root@dev:~# apt-cache policy sudo
N: Unable to locate package sudo
root@dev:~# apt-get install sudo
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package sudo
root@dev:~# apt-cache policy sudo
N: Unable to locate package sudo
root@dev:~# sudo apt-get install apache2
-bash: sudo: command not found
root@dev:~# apt-get install apache2
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package apache2
EDIT:
Ran; apt-get update and then tried again. Worked!
apache2 sudo
apache2 sudo
edited Dec 29 '18 at 5:16
karel
57.3k12127146
57.3k12127146
asked Nov 8 '15 at 15:30
Hees1989
1254
1254
Does su work instead of sudo?
– Raphael
Nov 8 '15 at 15:38
1
Are you running as root? Please edit your question and add the output ofwhoamiandapt-cache policy sudo.
– muru
Nov 8 '15 at 15:43
1
which sudoshows anything? If not please add results frommore /etc/lsb-release
– Rinzwind
Nov 8 '15 at 15:46
1
@Rinzwind - I have a question. OP says that he is running as root right? So, he can use apt-get install sudo to install it, can't he?
– Raphael
Nov 8 '15 at 15:54
@muru Yes, whoami outputs root. The other returns; N: Unable to locate package sudo. So I guess it isn't installed yet. Going to look into that now. As I said, I'm new to this.
– Hees1989
Nov 8 '15 at 15:54
|
show 7 more comments
Does su work instead of sudo?
– Raphael
Nov 8 '15 at 15:38
1
Are you running as root? Please edit your question and add the output ofwhoamiandapt-cache policy sudo.
– muru
Nov 8 '15 at 15:43
1
which sudoshows anything? If not please add results frommore /etc/lsb-release
– Rinzwind
Nov 8 '15 at 15:46
1
@Rinzwind - I have a question. OP says that he is running as root right? So, he can use apt-get install sudo to install it, can't he?
– Raphael
Nov 8 '15 at 15:54
@muru Yes, whoami outputs root. The other returns; N: Unable to locate package sudo. So I guess it isn't installed yet. Going to look into that now. As I said, I'm new to this.
– Hees1989
Nov 8 '15 at 15:54
Does su work instead of sudo?
– Raphael
Nov 8 '15 at 15:38
Does su work instead of sudo?
– Raphael
Nov 8 '15 at 15:38
1
1
Are you running as root? Please edit your question and add the output of
whoami and apt-cache policy sudo.– muru
Nov 8 '15 at 15:43
Are you running as root? Please edit your question and add the output of
whoami and apt-cache policy sudo.– muru
Nov 8 '15 at 15:43
1
1
which sudo shows anything? If not please add results from more /etc/lsb-release– Rinzwind
Nov 8 '15 at 15:46
which sudo shows anything? If not please add results from more /etc/lsb-release– Rinzwind
Nov 8 '15 at 15:46
1
1
@Rinzwind - I have a question. OP says that he is running as root right? So, he can use apt-get install sudo to install it, can't he?
– Raphael
Nov 8 '15 at 15:54
@Rinzwind - I have a question. OP says that he is running as root right? So, he can use apt-get install sudo to install it, can't he?
– Raphael
Nov 8 '15 at 15:54
@muru Yes, whoami outputs root. The other returns; N: Unable to locate package sudo. So I guess it isn't installed yet. Going to look into that now. As I said, I'm new to this.
– Hees1989
Nov 8 '15 at 15:54
@muru Yes, whoami outputs root. The other returns; N: Unable to locate package sudo. So I guess it isn't installed yet. Going to look into that now. As I said, I'm new to this.
– Hees1989
Nov 8 '15 at 15:54
|
show 7 more comments
2 Answers
2
active
oldest
votes
As you are root you shouldn't need sudo to run the command. Try running the commands without sudo as in apt-get install apache2 for example.
Source: experience
add a comment |
Maybe it isn't installed? Open your package manager and install the sudo package.
taken from another question on unix & Linux.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f695492%2fsudo-command-not-found%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As you are root you shouldn't need sudo to run the command. Try running the commands without sudo as in apt-get install apache2 for example.
Source: experience
add a comment |
As you are root you shouldn't need sudo to run the command. Try running the commands without sudo as in apt-get install apache2 for example.
Source: experience
add a comment |
As you are root you shouldn't need sudo to run the command. Try running the commands without sudo as in apt-get install apache2 for example.
Source: experience
As you are root you shouldn't need sudo to run the command. Try running the commands without sudo as in apt-get install apache2 for example.
Source: experience
answered Nov 8 '15 at 16:21
Elder Geek
26.4k952125
26.4k952125
add a comment |
add a comment |
Maybe it isn't installed? Open your package manager and install the sudo package.
taken from another question on unix & Linux.
add a comment |
Maybe it isn't installed? Open your package manager and install the sudo package.
taken from another question on unix & Linux.
add a comment |
Maybe it isn't installed? Open your package manager and install the sudo package.
taken from another question on unix & Linux.
Maybe it isn't installed? Open your package manager and install the sudo package.
taken from another question on unix & Linux.
edited Apr 13 '17 at 12:37
Community♦
1
1
answered Nov 8 '15 at 15:43
biozalp
447312
447312
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f695492%2fsudo-command-not-found%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Does su work instead of sudo?
– Raphael
Nov 8 '15 at 15:38
1
Are you running as root? Please edit your question and add the output of
whoamiandapt-cache policy sudo.– muru
Nov 8 '15 at 15:43
1
which sudoshows anything? If not please add results frommore /etc/lsb-release– Rinzwind
Nov 8 '15 at 15:46
1
@Rinzwind - I have a question. OP says that he is running as root right? So, he can use apt-get install sudo to install it, can't he?
– Raphael
Nov 8 '15 at 15:54
@muru Yes, whoami outputs root. The other returns; N: Unable to locate package sudo. So I guess it isn't installed yet. Going to look into that now. As I said, I'm new to this.
– Hees1989
Nov 8 '15 at 15:54