sudo: command not found












3














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!










share|improve this question
























  • 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 whoami and apt-cache policy sudo.
    – muru
    Nov 8 '15 at 15:43






  • 1




    which sudo shows anything? If not please add results from more /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
















3














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!










share|improve this question
























  • 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 whoami and apt-cache policy sudo.
    – muru
    Nov 8 '15 at 15:43






  • 1




    which sudo shows anything? If not please add results from more /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














3












3








3







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!










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 of whoami and apt-cache policy sudo.
    – muru
    Nov 8 '15 at 15:43






  • 1




    which sudo shows anything? If not please add results from more /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






  • 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






  • 1




    which sudo shows anything? If not please add results from more /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










2 Answers
2






active

oldest

votes


















2














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






share|improve this answer





























    0














    Maybe it isn't installed? Open your package manager and install the sudo package.



    taken from another question on unix & Linux.






    share|improve this answer























      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
      });


      }
      });














      draft saved

      draft discarded


















      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









      2














      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






      share|improve this answer


























        2














        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






        share|improve this answer
























          2












          2








          2






          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






          share|improve this answer












          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







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 8 '15 at 16:21









          Elder Geek

          26.4k952125




          26.4k952125

























              0














              Maybe it isn't installed? Open your package manager and install the sudo package.



              taken from another question on unix & Linux.






              share|improve this answer




























                0














                Maybe it isn't installed? Open your package manager and install the sudo package.



                taken from another question on unix & Linux.






                share|improve this answer


























                  0












                  0








                  0






                  Maybe it isn't installed? Open your package manager and install the sudo package.



                  taken from another question on unix & Linux.






                  share|improve this answer














                  Maybe it isn't installed? Open your package manager and install the sudo package.



                  taken from another question on unix & Linux.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 13 '17 at 12:37









                  Community

                  1




                  1










                  answered Nov 8 '15 at 15:43









                  biozalp

                  447312




                  447312






























                      draft saved

                      draft discarded




















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      Category:香港粉麵

                      List *all* the tuples!

                      Channel [V]