Bash Sudo Command Not Found Announcing the arrival of Valued Associate #679: Cesar Manara ...

Identifying polygons that intersect with another layer using QGIS?

How to call a function with default parameter through a pointer to function that is the return of another function?

Check which numbers satisfy the condition [A*B*C = A! + B! + C!]

How do I stop a creek from eroding my steep embankment?

What does this icon in iOS Stardew Valley mean?

What is Wonderstone and are there any references to it pre-1982?

Echoing a tail command produces unexpected output?

English words in a non-english sci-fi novel

Why is my conclusion inconsistent with the van't Hoff equation?

Why am I getting the error "non-boolean type specified in a context where a condition is expected" for this request?

Storing hydrofluoric acid before the invention of plastics

List of Python versions

When were vectors invented?

Book where humans were engineered with genes from animal species to survive hostile planets

Can a USB port passively 'listen only'?

Why is "Consequences inflicted." not a sentence?

How to tell that you are a giant?

Why did the Falcon Heavy center core fall off the ASDS OCISLY barge?

Why didn't this character "real die" when they blew their stack out in Altered Carbon?

How come Sam didn't become Lord of Horn Hill?

How does debian/ubuntu knows a package has a updated version

Why do we bend a book to keep it straight?

How widely used is the term Treppenwitz? Is it something that most Germans know?

Can an alien society believe that their star system is the universe?



Bash Sudo Command Not Found



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionsudo script in my $HOME/bin foldersudo askpass: ask from other ttybash does not autocomplete my command when using sudo?shared object file open error with “sudo command” but NOT with “sudo bash” then same command?Sudo complains “is not in the sudoers file”When I run “sudo su” I get --bash: command not found for everythingProblem with sudoing ssh - `sudo ssh …` failsPuppy precise - sudo command not found on bootable CDGetting “command not found” when trying to run rvm command as sudobash: ‘export: command not foundShall I run a sudo-required script in some shell configuration file?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







32















I have set up a VM using turnkey linux redmine and I'm trying to SSH into the server to install some more items.



It doesn't appear to be recognizing the sudo command. Every time I try to sudo something I get an error saying:



 -bash: sudo: command not found


I read somewhere else to type 'whereis sudo' and the output was:



 sudo:









share|improve this question















migrated from askubuntu.com Oct 29 '11 at 21:21


This question came from our site for Ubuntu users and developers.

























    32















    I have set up a VM using turnkey linux redmine and I'm trying to SSH into the server to install some more items.



    It doesn't appear to be recognizing the sudo command. Every time I try to sudo something I get an error saying:



     -bash: sudo: command not found


    I read somewhere else to type 'whereis sudo' and the output was:



     sudo:









    share|improve this question















    migrated from askubuntu.com Oct 29 '11 at 21:21


    This question came from our site for Ubuntu users and developers.





















      32












      32








      32


      2






      I have set up a VM using turnkey linux redmine and I'm trying to SSH into the server to install some more items.



      It doesn't appear to be recognizing the sudo command. Every time I try to sudo something I get an error saying:



       -bash: sudo: command not found


      I read somewhere else to type 'whereis sudo' and the output was:



       sudo:









      share|improve this question
















      I have set up a VM using turnkey linux redmine and I'm trying to SSH into the server to install some more items.



      It doesn't appear to be recognizing the sudo command. Every time I try to sudo something I get an error saying:



       -bash: sudo: command not found


      I read somewhere else to type 'whereis sudo' and the output was:



       sudo:






      bash sudo






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 hours ago









      Rui F Ribeiro

      42.1k1484142




      42.1k1484142










      asked Oct 29 '11 at 17:00







      Adam











      migrated from askubuntu.com Oct 29 '11 at 21:21


      This question came from our site for Ubuntu users and developers.









      migrated from askubuntu.com Oct 29 '11 at 21:21


      This question came from our site for Ubuntu users and developers.
























          5 Answers
          5






          active

          oldest

          votes


















          18














          It looks from http://www.turnkeylinux.org/redmine like Redmine, unlike Ubuntu, does not use sudo by default. What username are you using to SSH in? If it's root, then you don't need to use sudo, as everything you do when SSHed in to the Redmine system is done as root. If it's something else, like admin, then you could try using the su command to get a root shell in which to run commands as root.






          share|improve this answer


























          • What to do when script has commands sudo. Happens to me with mkusb. Its better to install sudo for future convenience .

            – Love Grover
            Jan 21 '17 at 12:59



















          40














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






          share|improve this answer



















          • 2





            It wasn't installed! Thanks. I'm pretty new to Linux and just assumed it was on all installations. Do i just need the sudo package or sudo-ldap as well?

            – Adam
            Oct 29 '11 at 17:14






          • 2





            You don't need the sudo-ldap package. Sudo works fine on my computer and I don't have sudo-ldap installed.

            – Azendale
            Oct 29 '11 at 17:20



















          5














          try to use full path



          /usr/bin/sudo


          if that command work then include /usr/bin/ in your env variable PATH in ~/.bashrc



          echo "export PATH="$PATH:/usr/bin"" >> ~/.bashrc


          hopefully works ..






          share|improve this answer



















          • 4





            That's very unlikely to be the problem; /usr/bin is almost certainly going to be in your default path. The problem, as indicated by other answers and comments, is that the sudo command wasn't installed at all.

            – Keith Thompson
            Oct 29 '11 at 22:25



















          3














          First login to your root account. Then



          $ apt-get install sudo


          Add your existing user to group sudo



          $ sudo adduser <user> sudo


          You should then login as <user>, and the sudo command should be there.






          share|improve this answer































            2














            The error happens because the binary you are trying to call from command line is only part of the current user's PATH variable, but not a part of root user's PATH.



            You can verify this by locating the path of the binary you are trying to access. In my case I was trying to call "bettercap-ng". So I ran,



            $ which bettercap-ng



            output: /home/user/work/bin/bettercap



            I checked whether this location is part of my root user's PATH.



            $ sudo env | grep ^PATH



            output: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin



            So sudo cannot find the binary that I am trying to call from commandline. Hence returns the error command not found.



            You can direct sudo to use the current user's PATH when calling a binary like below.



            $ sudo -E env "PATH=$PATH" [command] [arguments]



            In fact, one can make an alias out of it:



            $ alias mysudo='sudo -E env "PATH=$PATH"'



            It's also possible to name the alias itself sudo, replacing the original sudo.



            Please refer to this video for step by step solution






            share|improve this answer
























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              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: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              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%2funix.stackexchange.com%2fquestions%2f23572%2fbash-sudo-command-not-found%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown
























              5 Answers
              5






              active

              oldest

              votes








              5 Answers
              5






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              18














              It looks from http://www.turnkeylinux.org/redmine like Redmine, unlike Ubuntu, does not use sudo by default. What username are you using to SSH in? If it's root, then you don't need to use sudo, as everything you do when SSHed in to the Redmine system is done as root. If it's something else, like admin, then you could try using the su command to get a root shell in which to run commands as root.






              share|improve this answer


























              • What to do when script has commands sudo. Happens to me with mkusb. Its better to install sudo for future convenience .

                – Love Grover
                Jan 21 '17 at 12:59
















              18














              It looks from http://www.turnkeylinux.org/redmine like Redmine, unlike Ubuntu, does not use sudo by default. What username are you using to SSH in? If it's root, then you don't need to use sudo, as everything you do when SSHed in to the Redmine system is done as root. If it's something else, like admin, then you could try using the su command to get a root shell in which to run commands as root.






              share|improve this answer


























              • What to do when script has commands sudo. Happens to me with mkusb. Its better to install sudo for future convenience .

                – Love Grover
                Jan 21 '17 at 12:59














              18












              18








              18







              It looks from http://www.turnkeylinux.org/redmine like Redmine, unlike Ubuntu, does not use sudo by default. What username are you using to SSH in? If it's root, then you don't need to use sudo, as everything you do when SSHed in to the Redmine system is done as root. If it's something else, like admin, then you could try using the su command to get a root shell in which to run commands as root.






              share|improve this answer















              It looks from http://www.turnkeylinux.org/redmine like Redmine, unlike Ubuntu, does not use sudo by default. What username are you using to SSH in? If it's root, then you don't need to use sudo, as everything you do when SSHed in to the Redmine system is done as root. If it's something else, like admin, then you could try using the su command to get a root shell in which to run commands as root.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Aug 8 '12 at 19:39

























              answered Oct 29 '11 at 17:09









              Eliah KaganEliah Kagan

              3,26221632




              3,26221632













              • What to do when script has commands sudo. Happens to me with mkusb. Its better to install sudo for future convenience .

                – Love Grover
                Jan 21 '17 at 12:59



















              • What to do when script has commands sudo. Happens to me with mkusb. Its better to install sudo for future convenience .

                – Love Grover
                Jan 21 '17 at 12:59

















              What to do when script has commands sudo. Happens to me with mkusb. Its better to install sudo for future convenience .

              – Love Grover
              Jan 21 '17 at 12:59





              What to do when script has commands sudo. Happens to me with mkusb. Its better to install sudo for future convenience .

              – Love Grover
              Jan 21 '17 at 12:59













              40














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






              share|improve this answer



















              • 2





                It wasn't installed! Thanks. I'm pretty new to Linux and just assumed it was on all installations. Do i just need the sudo package or sudo-ldap as well?

                – Adam
                Oct 29 '11 at 17:14






              • 2





                You don't need the sudo-ldap package. Sudo works fine on my computer and I don't have sudo-ldap installed.

                – Azendale
                Oct 29 '11 at 17:20
















              40














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






              share|improve this answer



















              • 2





                It wasn't installed! Thanks. I'm pretty new to Linux and just assumed it was on all installations. Do i just need the sudo package or sudo-ldap as well?

                – Adam
                Oct 29 '11 at 17:14






              • 2





                You don't need the sudo-ldap package. Sudo works fine on my computer and I don't have sudo-ldap installed.

                – Azendale
                Oct 29 '11 at 17:20














              40












              40








              40







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






              share|improve this answer













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







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Oct 29 '11 at 17:07







              Timo















              • 2





                It wasn't installed! Thanks. I'm pretty new to Linux and just assumed it was on all installations. Do i just need the sudo package or sudo-ldap as well?

                – Adam
                Oct 29 '11 at 17:14






              • 2





                You don't need the sudo-ldap package. Sudo works fine on my computer and I don't have sudo-ldap installed.

                – Azendale
                Oct 29 '11 at 17:20














              • 2





                It wasn't installed! Thanks. I'm pretty new to Linux and just assumed it was on all installations. Do i just need the sudo package or sudo-ldap as well?

                – Adam
                Oct 29 '11 at 17:14






              • 2





                You don't need the sudo-ldap package. Sudo works fine on my computer and I don't have sudo-ldap installed.

                – Azendale
                Oct 29 '11 at 17:20








              2




              2





              It wasn't installed! Thanks. I'm pretty new to Linux and just assumed it was on all installations. Do i just need the sudo package or sudo-ldap as well?

              – Adam
              Oct 29 '11 at 17:14





              It wasn't installed! Thanks. I'm pretty new to Linux and just assumed it was on all installations. Do i just need the sudo package or sudo-ldap as well?

              – Adam
              Oct 29 '11 at 17:14




              2




              2





              You don't need the sudo-ldap package. Sudo works fine on my computer and I don't have sudo-ldap installed.

              – Azendale
              Oct 29 '11 at 17:20





              You don't need the sudo-ldap package. Sudo works fine on my computer and I don't have sudo-ldap installed.

              – Azendale
              Oct 29 '11 at 17:20











              5














              try to use full path



              /usr/bin/sudo


              if that command work then include /usr/bin/ in your env variable PATH in ~/.bashrc



              echo "export PATH="$PATH:/usr/bin"" >> ~/.bashrc


              hopefully works ..






              share|improve this answer



















              • 4





                That's very unlikely to be the problem; /usr/bin is almost certainly going to be in your default path. The problem, as indicated by other answers and comments, is that the sudo command wasn't installed at all.

                – Keith Thompson
                Oct 29 '11 at 22:25
















              5














              try to use full path



              /usr/bin/sudo


              if that command work then include /usr/bin/ in your env variable PATH in ~/.bashrc



              echo "export PATH="$PATH:/usr/bin"" >> ~/.bashrc


              hopefully works ..






              share|improve this answer



















              • 4





                That's very unlikely to be the problem; /usr/bin is almost certainly going to be in your default path. The problem, as indicated by other answers and comments, is that the sudo command wasn't installed at all.

                – Keith Thompson
                Oct 29 '11 at 22:25














              5












              5








              5







              try to use full path



              /usr/bin/sudo


              if that command work then include /usr/bin/ in your env variable PATH in ~/.bashrc



              echo "export PATH="$PATH:/usr/bin"" >> ~/.bashrc


              hopefully works ..






              share|improve this answer













              try to use full path



              /usr/bin/sudo


              if that command work then include /usr/bin/ in your env variable PATH in ~/.bashrc



              echo "export PATH="$PATH:/usr/bin"" >> ~/.bashrc


              hopefully works ..







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Oct 29 '11 at 17:06







              Imam Omar















              • 4





                That's very unlikely to be the problem; /usr/bin is almost certainly going to be in your default path. The problem, as indicated by other answers and comments, is that the sudo command wasn't installed at all.

                – Keith Thompson
                Oct 29 '11 at 22:25














              • 4





                That's very unlikely to be the problem; /usr/bin is almost certainly going to be in your default path. The problem, as indicated by other answers and comments, is that the sudo command wasn't installed at all.

                – Keith Thompson
                Oct 29 '11 at 22:25








              4




              4





              That's very unlikely to be the problem; /usr/bin is almost certainly going to be in your default path. The problem, as indicated by other answers and comments, is that the sudo command wasn't installed at all.

              – Keith Thompson
              Oct 29 '11 at 22:25





              That's very unlikely to be the problem; /usr/bin is almost certainly going to be in your default path. The problem, as indicated by other answers and comments, is that the sudo command wasn't installed at all.

              – Keith Thompson
              Oct 29 '11 at 22:25











              3














              First login to your root account. Then



              $ apt-get install sudo


              Add your existing user to group sudo



              $ sudo adduser <user> sudo


              You should then login as <user>, and the sudo command should be there.






              share|improve this answer




























                3














                First login to your root account. Then



                $ apt-get install sudo


                Add your existing user to group sudo



                $ sudo adduser <user> sudo


                You should then login as <user>, and the sudo command should be there.






                share|improve this answer


























                  3












                  3








                  3







                  First login to your root account. Then



                  $ apt-get install sudo


                  Add your existing user to group sudo



                  $ sudo adduser <user> sudo


                  You should then login as <user>, and the sudo command should be there.






                  share|improve this answer













                  First login to your root account. Then



                  $ apt-get install sudo


                  Add your existing user to group sudo



                  $ sudo adduser <user> sudo


                  You should then login as <user>, and the sudo command should be there.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 12 '18 at 10:09









                  Gayan WeerakuttiGayan Weerakutti

                  1836




                  1836























                      2














                      The error happens because the binary you are trying to call from command line is only part of the current user's PATH variable, but not a part of root user's PATH.



                      You can verify this by locating the path of the binary you are trying to access. In my case I was trying to call "bettercap-ng". So I ran,



                      $ which bettercap-ng



                      output: /home/user/work/bin/bettercap



                      I checked whether this location is part of my root user's PATH.



                      $ sudo env | grep ^PATH



                      output: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin



                      So sudo cannot find the binary that I am trying to call from commandline. Hence returns the error command not found.



                      You can direct sudo to use the current user's PATH when calling a binary like below.



                      $ sudo -E env "PATH=$PATH" [command] [arguments]



                      In fact, one can make an alias out of it:



                      $ alias mysudo='sudo -E env "PATH=$PATH"'



                      It's also possible to name the alias itself sudo, replacing the original sudo.



                      Please refer to this video for step by step solution






                      share|improve this answer




























                        2














                        The error happens because the binary you are trying to call from command line is only part of the current user's PATH variable, but not a part of root user's PATH.



                        You can verify this by locating the path of the binary you are trying to access. In my case I was trying to call "bettercap-ng". So I ran,



                        $ which bettercap-ng



                        output: /home/user/work/bin/bettercap



                        I checked whether this location is part of my root user's PATH.



                        $ sudo env | grep ^PATH



                        output: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin



                        So sudo cannot find the binary that I am trying to call from commandline. Hence returns the error command not found.



                        You can direct sudo to use the current user's PATH when calling a binary like below.



                        $ sudo -E env "PATH=$PATH" [command] [arguments]



                        In fact, one can make an alias out of it:



                        $ alias mysudo='sudo -E env "PATH=$PATH"'



                        It's also possible to name the alias itself sudo, replacing the original sudo.



                        Please refer to this video for step by step solution






                        share|improve this answer


























                          2












                          2








                          2







                          The error happens because the binary you are trying to call from command line is only part of the current user's PATH variable, but not a part of root user's PATH.



                          You can verify this by locating the path of the binary you are trying to access. In my case I was trying to call "bettercap-ng". So I ran,



                          $ which bettercap-ng



                          output: /home/user/work/bin/bettercap



                          I checked whether this location is part of my root user's PATH.



                          $ sudo env | grep ^PATH



                          output: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin



                          So sudo cannot find the binary that I am trying to call from commandline. Hence returns the error command not found.



                          You can direct sudo to use the current user's PATH when calling a binary like below.



                          $ sudo -E env "PATH=$PATH" [command] [arguments]



                          In fact, one can make an alias out of it:



                          $ alias mysudo='sudo -E env "PATH=$PATH"'



                          It's also possible to name the alias itself sudo, replacing the original sudo.



                          Please refer to this video for step by step solution






                          share|improve this answer













                          The error happens because the binary you are trying to call from command line is only part of the current user's PATH variable, but not a part of root user's PATH.



                          You can verify this by locating the path of the binary you are trying to access. In my case I was trying to call "bettercap-ng". So I ran,



                          $ which bettercap-ng



                          output: /home/user/work/bin/bettercap



                          I checked whether this location is part of my root user's PATH.



                          $ sudo env | grep ^PATH



                          output: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin



                          So sudo cannot find the binary that I am trying to call from commandline. Hence returns the error command not found.



                          You can direct sudo to use the current user's PATH when calling a binary like below.



                          $ sudo -E env "PATH=$PATH" [command] [arguments]



                          In fact, one can make an alias out of it:



                          $ alias mysudo='sudo -E env "PATH=$PATH"'



                          It's also possible to name the alias itself sudo, replacing the original sudo.



                          Please refer to this video for step by step solution







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 8 '18 at 9:46









                          Anonymous PlatypusAnonymous Platypus

                          1234




                          1234






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • 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%2funix.stackexchange.com%2fquestions%2f23572%2fbash-sudo-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

                              Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                              Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                              Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...