8

I tried to install homebrew onto my mac, but I couldn't because curl wasn't found. I typed:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

This returned this error:

-bash: curl: command not found

So, I tried to install curl but apparently to install curl, I need to use curl? This is what I found:

  1. Run in Terminal app:

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null

  2. Run: brew install curl

Done! You can now use curl.

However, this uses curl to install curl, so it gives the same error message: -bash: curl: command not found

TL;DR, how do I install curl on mac without using curl

Omaro_IB
  • 379
  • 1
  • 3
  • 13

5 Answers5

10

I solved the problem!

To use bash on mac:

  1. Go to terminal ––> preferences
  2. Click on Shells open with: and set it to Command (complete path)
  3. Enter one of the following:

    • /bin/bash
    • /bin/csh
    • /bin/zsh
    • /bin/zsh-4.0.4 (Mac OS X 10.2.8 or earlier)
    • /bin/zsh-4.1.1 (Mac OS X 10.3 or later)
    • /bin/ksh (Mac OS X 10.4 or later)

/bin/ksh worked for me

Source

Omaro_IB
  • 379
  • 1
  • 3
  • 13
  • 5
    This indicates that you've broken your PATH for bash somehow... curl is available by default in macOS - since 2001! You could just have use the full path to curl instead: `/usr/bin/curl`. – Daniel Stenberg Nov 09 '18 at 11:23
1

I thought I broke my curl symlink somehow too, and somewhere in there I ran into your same issue, where no command would work. Somewhere in this mess, I fixed it.

https://brew.sh/

The main website requires you to install wget, maybe it gets deleted when you uninstall homebrew.

Regardless I found a way to install it using Ubuntu commands.

https://xmrig.com/docs/miner/build/ubuntu

but ran into an issue where I had to download cmake from the developer website and add it to the path in it's menu options on Mac OS X 10.11 to compile and run my program as ./program instead of program, then I installed macports(opened a new terminal window), and installed hwloc with macports, to no avail, just getting totally different errors.

I've also tried to add curl as an alias of curl into the bash profile and it recognized the error after I used this; https://github.com/Homebrew/homebrew-core/issues/5084

However, I forgot I have an identical computer that is working just fine, but when I run "which curl", in the working computer, I get /usr/bin/curl, instead of /usr/local/bin/curl, so I ran

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin/curl"

I'm still getting the error, so I used vim, to sudo edit the /etc/paths file by using

sudo vim /etc/paths i for edit esc to exit edit mode :x to save

Restart Terminal

Still getting a 403 SNI Error cannot download Python 3.9

rm -rf /opt/local/bin/curl rm -rf /usr/local/bin/curl

which curl finally returns the correct path, /usr/bin/curl exit

Restart Terminal

Still same error so I removed /usr/bin/curl from /etc/paths, and export file. Also deleted the bash profile, as the working computer doesn't return one, and...still the same error, so I conclude that "curl is not in path" should be ignored.

I did get brew doctor to return with no errors. brew upgrade curl curl not installed brew install curl 403 Error SNI is required.

brew upgrade openssl openssl 1.1.1j already installed

GettingNifty
  • 121
  • 1
  • 6
0

In my case, I made a mistake while editing my $PATH.

I would recommend looking at all your ~/.bash_profile and ~/.zshrc.

Remove ALL code related to $PATH. Carefully add things back in.

Devin Rhode
  • 23,026
  • 8
  • 58
  • 72
0

This is how I solved it :

  • Search for "User and Group" in spotlight search .
  • Right click on Admin User -> Advanced Option.
  • Change Login Shell to /bin/ksh .
  • Save and reopen the terminal.

And then curl command starts working .

0

Nothing to do with PATH for me. My solution was to run:

brew install curl

maxp
  • 24,209
  • 39
  • 123
  • 201