sudo - command not found

Joined
Sep 20, 2015
Messages
8
Reaction score
0
Points
1
Hi,
I'm trying to install a patch onto a program but when I open the patch.command file, the patch tries to run but comes up with error messages:
"> Applying patches...
/Users/Chris/Desktop/Patch.command: line 14: sudo: command not found
/Users/Chris/Desktop/Patch.command: line 16: sudo: command not found
/Users/Chris/Desktop/Patch.command: line 18: sudo: command not found
/Users/Chris/Desktop/Patch.command: line 20: sudo: command not found"

When i open a terminal window and type in "sudo" it comes back with "-bash: sudo: command not found". Same thing for "which sudo" except the command "which" is not found. I'm a complete beginner and know nothing about programming so sorry if i've said anything wrong or this is the wrong area of the forum. ?
Thanks
 
Last edited:
Joined
Apr 26, 2008
Messages
2,963
Reaction score
120
Points
63
Location
Belgium
Your Mac's Specs
iPad Pro 12.9 latest iOS
What program are you trying to patch ?
What OS and version of the OS are you running ?

Cheers ... McBie
 
Joined
Apr 26, 2008
Messages
2,963
Reaction score
120
Points
63
Location
Belgium
Your Mac's Specs
iPad Pro 12.9 latest iOS
What version of Ableton Live and where did you get the update from ?

Cheers ... McBie
 
OP
T
Joined
Sep 20, 2015
Messages
8
Reaction score
0
Points
1
I believe it's version 9.1.9 , but I don't think it's to do with the update as when I enter "which sudo" or "sudo" these commands aren't found. When I was rooting my android phone I also had problems with Terminal when i tried to add commands to my $PATH. Is there any way i can fix the "sudo" command so that the patch will work properly?
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Open Terminal and type "echo $PATH" without the quotes. Make sure /usr/bin is in there.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I, like cradom, suspect that this is simply a case of an incorrect PATH variable set. What did you change previously?
 
OP
T
Joined
Sep 20, 2015
Messages
8
Reaction score
0
Points
1
When i input echo $PATH all it returns is $ ... Obviously there's something wrong here. Would you be able to help me fix this? I haven't changed anything previously
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Do you have a file called .bash_profile or .bashrc in your home directory (given that it starts with a ., it will be hidden). What do you see if you execute the following?
Code:
ls -a
If you don't have a .bash_profile, a simple solution to this issue is to create a file called .bash_profile in your home directory with the following contents:
Code:
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
export PATH
Restart Terminal and you should be good to go.
 
OP
T
Joined
Sep 20, 2015
Messages
8
Reaction score
0
Points
1
This is what comes up if i execute that:
. Applications
.. Desktop
.CFUserTextEncoding Documents
.DS_Store Downloads
.MakeMKV Knight and Day (Extended Edition)
.Motorola Mobility Library
.Trash Movies
.android Music
.bash_history Pictures
.bash_profile Public
.config cminstaller
.cups jagex_cl_runescape_LIVE.dat
.dropbox jagexcache
.jagex_cache_32 random.dat
.local

Sorry about the formatting but .bash_profile is in there.
 
OP
T
Joined
Sep 20, 2015
Messages
8
Reaction score
0
Points
1
If i input export $PATH this comes up:
-bash: export: `/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin': not a valid identifier

Not sure what this means?
 
OP
T
Joined
Sep 20, 2015
Messages
8
Reaction score
0
Points
1
I just tried to use sudo and it works! Thank you so much :D

Edit: I closed the terminal window and sudo no longer works. Is there a more permanent solution? :(
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Open Terminal and do that command again:
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
export PATH

Copy it from Van's post Now, without closing Terminal type:
nano .bash_profile
A "window" will open up. This is the nano editor.
Paste the command into the window (this is assuming it's not already there).
Now do a control-x. It will ask if you want to save, yes.
Restart Terminal. It should work now.
 

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,612
Reaction score
1,078
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Ventura, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
I'm going to take my anti-hive meds now and whimper in the corner. ;D
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Just pet the bunny. Takes care of everything...
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
One day Sly, one day we'll get you to embrace the command line.
 

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,612
Reaction score
1,078
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Ventura, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
Joined
Oct 16, 2010
Messages
17,540
Reaction score
1,576
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2011 27" iMac, 1TB(partitioned) SSD, 20GB, OS X 10.11.6 El Capitan

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top