145

I tried to enable curl on cygwin but it says bash: curl: command not found

How do I install curl on cygwin?

Drew LeSueur
  • 19,185
  • 29
  • 89
  • 106

17 Answers17

270

I just encountered this.

1) Find the cygwin setup.exe file from http://cygwin.com/ and run it.
2) Click/enter preferences until you reach the "Select Packages" window. (See image)
3) Click (+) for Net
4) Click the entry for curl. (Make sure you select the checkbox for the Binary)
5) Install.
6) Open a cygwin window and type curl.exe (should be available now).

Cygwin package manager

farheen
  • 1,786
  • 1
  • 15
  • 22
ibaralf
  • 12,218
  • 5
  • 47
  • 69
  • 3
    This helped me out considerably. I was having the same issue and was getting absolutely nowhere with the Windows CMD prompt. Thank you very much. – somecallmejosh Jan 04 '13 at 19:33
  • 3
    This answer is definitely more useful per say its easier to follow (more up votes), mentions clearly that setup has to be downloaded from cygwin website. It's a strong candidate of being selected as and answer. – Soumen May 28 '13 at 11:02
  • 10
    This might be quicker: Run `setup-x86.exe -q -P curl` in windows cmd window. – gm2008 Jul 10 '14 at 08:38
  • 1
    Also you might have to grab libcurl-devel. Wouldn't work for me until I did that. – user3624582 Sep 07 '14 at 07:46
  • I already had the curl package installer, but just after reinstalling the package, the `curl.exe` executable has appeared on `/usr/bin` directory. – brrystrw Jan 26 '15 at 11:14
  • 1
    2.5) Can search for curl, that'll cut thru some of the scrolling. Search box shown in helpful screen above at the top. – joedragons Feb 27 '15 at 22:18
  • Make sure to click on the circular arrows until the word "Skip" is switched to a current version number for the selected package. Cygwin's gui for this package manager is TERRIBLE – Salvador Valencia Feb 01 '17 at 19:48
  • 1
    @ibaralf I know this is a super old post. But thanks for this answer, it seriously helped me. Came form a linux and Mac over to Windows and have been struggling to get Cygwin all set up. – Josh Apr 02 '18 at 18:57
  • Thx for help. I had to remove `apt-get remove curl libcurl4 libmetalink3 libopenssl100 zlib0` and then install curl with all dependencies again. Somehow I did not notice I downloaded and installed currupted tar.xz packages. – ibre5041 Mar 05 '20 at 19:53
90

In the Cygwin package manager, click on curl from within the "net" category. Yes, it's that simple.

Dave
  • 21,524
  • 28
  • 141
  • 221
Jörg W Mittag
  • 363,080
  • 75
  • 446
  • 653
  • 17
    As @Casebash said it is the setup.exe and the `Category` name is Net, in that look for package name `curl` and select it. – Kuldeep Jain Oct 19 '13 at 07:42
  • It worked for me after couple tries. Make sure you select a server that's in your country. – user227353 Jan 08 '15 at 16:18
  • 1
    I would prefer the method using apt-cyg as stated in other answers. – Moonlit Sep 15 '15 at 06:12
  • The "package manager" is the setup.exe BUT make sure you go through the same installation directories for your Cygwin program files and your Local Package directory so you don't loose previous installed packages. When something can go wrong, it will = Not simple – Salvador Valencia Feb 01 '17 at 19:45
  • but in my case it wasn't available in the package manager doing a local install, but it was with a net install. So you may need to do that. – PlantationGator Feb 13 '19 at 23:56
72

Nobody said how to install apt-cyg

in cygwin

lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
install apt-cyg /bin

now you can

apt-cyg install curl

For more, see the official github repository of apt-cyg.

ZuzEL
  • 12,768
  • 8
  • 47
  • 68
33

apt-cyg is a great installer similar to apt-get to easily install any packages for Cygwin.

$ apt-cyg install curl

Note: apt-cyg should be first installed. You can do this from Windows command line:

cd c:\cygwin
cygwinsetup.exe -q -P wget,tar,qawk, bzip2,vim,lynx

Close Windows cmd, and open Cygwin Bash.

$ lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg install apt-cyg /bin
$ chmod +x /bin/apt-cyg
gavioto
  • 1,695
  • 2
  • 17
  • 38
sagunms
  • 8,030
  • 5
  • 41
  • 43
  • 2
    Sorry. Why not just install curl using setup.exe directly: `setup-x86.exe -q -P curl`. But thanks for the post. Did not know the cygwin setup's command line use before. – gm2008 Jul 10 '14 at 08:36
  • 2
    Once installed, with ``apt-cyg`` you have a bunch of comfortable possibilities to manage your packages, like searching or updating packages, list install packages and their dependencies, and more, just like using apt-get or yum on a regular linux shell. – Moonlit Sep 15 '15 at 06:17
  • 1
    I edited the question for updated installation method – gavioto Oct 01 '15 at 18:35
  • 1
    How to install the `lynx `. – qg_java_17137 Aug 21 '18 at 07:11
  • Not working for me. It did some processing but in the end cmd prompt hangs. – A_01 Sep 16 '18 at 09:56
19

In order to use the command-line version of curl, you need the curl executable. So, run the Cygwins Setup.exe, and select curl (under Net->curl). That one uses libcurl3, which is located in Libs->libcurl3. But libcurl3 will be pulled in as a dependency if it's not already installed. So, just select Net->curl and you're good to go.

Amy
  • 1,814
  • 2
  • 23
  • 38
10

In order to install any package,we must first find the setup.exe file.I could not locate this file.so i downloaded this file (or you can do a wget).I am on windows64 bit.So ,if you go to https://cygwin.com/install.html ,you can download setup-x86_64.exe file from the install and updates section,move this setup-x86_64.exe to your c:/cygwin64,and then run it from there ( setup-x86_64.exe -q -P curl)

harryy000
  • 553
  • 3
  • 9
4

I searched for curl on the cygwin packages part of their home page.

I found this link http://cygwin.com/packages/curl/. But that wasn't helpful because I couldn't download anything

So I searched for the curl-7.20.1-1 cygwin on Google. I found this helpful site mirrors.xmission.com/cygwin/release/curl/

That site had a link to download curl-7.20.1-1.tar.bz2. I unzipped it using 7zip. It unzips it into ./user/bin/ or something so I had to find curl.exe in the local /usr/bin folder and put it into my /bin folder of c:\cygwin

Finally I could use cURL!

This drove me crazy. I hope it helps someone!

Drew LeSueur
  • 19,185
  • 29
  • 89
  • 106
  • Next time use cygwin's setup.exe it will just let you install packages from there. You can also get a program called cyg-apt which works like Debian/Ubuntu's apt-get. http://code.google.com/p/cyg-apt/ – ocodo Sep 05 '10 at 20:28
  • 1
    I tried to run setup.exe, but I couldn't find curl in the list. I don't know what I did wrong. – Drew LeSueur Sep 12 '10 at 09:28
2

I just ran into this.

If you're not seeing curl in the list (see ibaralf's screenshot), then you may have out-of-date cygwin sources. In one of the screens in cygwin's setup.exe wizard, you have the option to "Install from Internet" or "Install from Local Directory". If you have the "Install from Local Directory" option enabled, then you may not see curl in the list. Switch to "Install from Internet" and select a mirror and then you should see curl.

idbrii
  • 10,975
  • 5
  • 66
  • 107
1

You can try:

apt-cyg install curl
Baz
  • 36,440
  • 11
  • 68
  • 94
qua
  • 972
  • 1
  • 8
  • 22
  • `apt-cyg: command not found` Is this only available on newer versions of Cygwin, or is it just a package that needs installed? My version is 1.7.16. – Lo-Tan Apr 12 '13 at 17:26
  • apt-cyg is a command-line installer for Cygwin which cooperates with Cygwin Setup and uses the same repository. The syntax is similar to apt-get https://code.google.com/p/apt-cyg/ – eric.christensen May 17 '13 at 17:45
  • That's because you need to install ``apt-cyg`` first. See https://github.com/transcode-open/apt-cyg – Moonlit Sep 15 '15 at 06:19
0

If someone is having problem with finding CURL in the list in setup.exe (Cygwin package manager) then trying downloading 64bit version of this setup. Worked for me.

FazoM
  • 4,777
  • 6
  • 43
  • 61
0

If you don't see a certain package, you can access to a full list of ports (also unnoficials, the packages you see on the web) launching the setup.exe with -k argument with value http://cygwinports.org/ports.gpg (example: C:\cygwin\setup\setup-x86.exe -K http://cygwinports.org/ports.gpg).

Doing so, you can choose a lot of extra packages, also extra versions of cURL (compat one). I do that to get Apache, cUrl, php5, php5-curl and some others :)

I don't know if apt-cyg can get those extra packages.

m3nda
  • 1,986
  • 3
  • 32
  • 45
0

I just copied the folder "curl-7.43.0" from zip file that I downloaded from curl website curl.haxx.se into cygwin64 folder on drive C:. And then I have used it with prefix curl in cygwin command terminal.

My actual download location from softpedia, I have used Softpedia Mirror (US)

  • 1
    If you install it directly, bypassing the Cygwin `setup*.exe` utility, you won't get updates. – Keith Thompson Jan 28 '16 at 05:18
  • When you are on a computer with no administrator privileges my method can help, Also I am not so sure that you can't update it manually with console, I don't have cygwin right now on my computer, and I don't use it any more, so you can try methods that are described in this [thread](http://superuser.com/questions/214831/how-to-update-cygwin-from-cygwins-command-line). and also [this thread](http://stackoverflow.com/questions/9260014/how-do-i-install-cygwin-components-from-the-command-line) – Slobodan Stanković Feb 05 '16 at 22:53
0

From the documentation:

Installing and Updating Cygwin for 64-bit versions of Windows

Run setup-x86_64.exe any time you want to update or install a Cygwin package for 64-bit windows. The signature for setup-x86_64.exe can be used to verify the validity of this binary using this public key.

https://cygwin.com/install.html

johnny
  • 19,272
  • 52
  • 157
  • 259
0

For future reference:

Cygwin comes with many packages (among them curl, as you found) to install one of them you run the setup.exe program.

lmcanavals
  • 2,339
  • 1
  • 24
  • 35
ase
  • 13,231
  • 4
  • 34
  • 46
  • 1
    I have cygwin installed on windows 7. I cant find setup.exe. doing: "apt-cyg install curl" gives command not found. Doing "$ cd c:\cygwin" gives no such file or dir. Start->allprogs->cygwin doesnt have start.exe or similar, only terminal. So I can launch a terminal, but not start.exe. Any ideas? – John Little Dec 02 '13 at 12:51
  • I cannot find a setup.exe either.HELP – Umesha Gunasinghe Jun 19 '14 at 19:59
  • Setup should have initialized before confirming the installation. If you missed that step may have to reinstall. – Len Joseph Mar 08 '19 at 05:29
0

On the Windows system where you want to install Cygwin with cURL download and run the Cygwin installer

64-bit: cygwin.com/setup-x86_64.exe 32-bit: cygwin.com/setup-x86.exe (if already installed, go to the setup file existed path)

D:\cygwin\setup (where the Cygwin is existed)

Click on the setup (setup-x86_64)

Follow the prompts in the Cygwin Setup wizard.

You can leave most settings at their default values. Pay specific attention to the following:

In the Select Your Internet Connectioin screen, select "Install from Internet".

In the Choose a download site screen, choose a site from the list, or add your own sites to the list, I have Chosen a: “mirrors.xmission.com”

The Select Packages screen displays a list of all the available packages and lets you select those you want to install. By default, only the packages in the "Base" category are marked for installation. The "Base" category does not include tools like cURL. You should select those explicitly.

By default, the packages are grouped by category. Click the View button to toggle to the Full view

Select all the curl packages by clicking the "Skip" button for each package once. Note how the "Skip" label changes to show the version number of the selected package.

the Select Packages screen should look like

Click Next through the rest of the wizard. The selected packages are downloaded and installed.

It worked for me and it resolved the issue : bash curl command not found cygwin

suresh
  • 23
  • 1
  • 7
0

Installing libcurl-devel worked for me. Run cygwin setup. After you reach the Select package window search for curl, as shown in the screenshot. Select libcurl-devel and install the package.

Arpan G
  • 86
  • 1
  • 4
  • While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value. Please read this [how-to-answer](http://stackoverflow.com/help/how-to-answer) for providing quality answer. – thewaywewere Jun 27 '17 at 15:10
-1

Even below will install curl

cd c:\cygwin setup.exe -q -P curl