最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】给Cygwin重新安装curl

Cygwin crifan 5563浏览 0评论

之前已经安装过了cygwin了,但是重装了系统了。

不过发现cygwin倒是还可以继续使用。

现在想要使用其中的curl工具。

但是却在cygwin安装目录

E:\dev_install_root\cygwin\bin

对应的bin下面没有找到curl.exe。

倒是很诡异的看到了curl-config文件。

现在想要给当前的cygwin安装curl。


1.由于之前

E:\Dev_Tools\Cygwin\cygwin_download_2

中已经有了之前安装时候所下载的本地的安装所需的文件,

所以其下有文件夹http%3a%2f%2fmirrors.163.com%2fcygwin%2f

http%3a%2f%2fmirrors.163.com%2fcygwin%2f下有release文件夹和setup.ini配置文件。

 

2.专门看了下那个setup.ini,导致找到了curl相关的内容:

@ curl
sdesc: "Multi-protocol file transfer command-line tool"
ldesc: "curl is a command line tool and library for transferring files
with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP,
TELNET, DICT, and FILE. curl supports SSL certificates, HTTP POST, HTTP
PUT, FTP uploading, HTTP form based upload, proxies, cookies,
user+password authentication (Basic, Digest, NTLM, Negotiate...), file
transfer resume, proxy tunneling and a busload of other useful tricks."
category: Net Web
requires: libcurl4 zlib0 cygwin
version: 7.24.0-3
install: release/curl/curl-7.24.0-3.tar.bz2 382557 a15eb0b04985a0be7e941b359d307768
source: release/curl/curl-7.24.0-3-src.tar.bz2 1985097 f23b3e091e052f7b3e9a54ee622ecf2f
[prev]
version: 7.24.0-2
install: release/curl/curl-7.24.0-2.tar.bz2 382165 935c3577492e3fe79eb4b1683a9716bb
source: release/curl/curl-7.24.0-2-src.tar.bz2 1985377 2d3603e9767c0de437a6a9a77da35e63

@ curl-devel
sdesc: "Obsolete package"
ldesc: "Obsolete package"
category: _obsolete
requires: libcurl-devel
version: 7.24.0-1
install: release/curl/curl-devel/curl-devel-7.24.0-1.tar.bz2 14 4059d198768f9f8dc9372dc1c54bc3c3

 

3.去运行之前的cygwin的安装文件setup.exe,然后选择从本地安装,然后选择上面的那个E:\Dev_Tools\Cygwin\cygwin_download_2文件夹。

然后可以自动解析,之后,在选择模块的界面,输入curl,找到了相关的curl的库,然后都设置为reinstall:

choose all curl

其中,参考了:

How do I install cURL on cygwin?

知道了curl是在Net下面的。

不过,很明显,上述我是已经不管三七二十一,把Libs,Net,Web的curl,全部选择上了。

然后点击下一步去安装。

然后就是很快的就下载并安装好了:

run to reinstall

结果很悲催的是,E:\dev_install_root\cygwin\bin下面,还是没有找到curl啊。

4.后来又去对应的

E:\Dev_Tools\Cygwin\cygwin_download_2\http%3a%2f%2fmirrors.163.com%2fcygwin%2f\release\curl

下看到了有已经下载的那4个相关的:

curl-devel,libcurl3,libcurl4,libcurl-devel

然后每个文件夹都有对应的tar文件,打开后发现,的确里面也都没有包含curl.exe,所以即使都安装上,也还是没有curl.exe的

5.然后又回去参考:

How do I install cURL on cygwin?

看到两种方法:

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.

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!

貌似第二种感觉更靠谱。

不过也可以先试试第一种。

然后继续重新运行setup.exe,期间还被告知有更新的版本的setup.exe,不过懒得管了。

然后继续,选择了那个:

choose ftp mirrors xmission com

ftp://mirrors.xmission.com

的源,然后下一步,然后搜curl,找到了真正想要的:

curl: Multi-protocol file transfer tool

must choose curl Multi-protocol file transfer tool

然后再点击下一步去安装,即可。

不过很悲催的是,由于不小心,没有取消全部的别的模块,所以估计是默认选择安装了很多别的模块,所以现在却是去下载很多别的模块:

install some others

索性取消掉算了。

然后又按照之前步骤重新执行一次,只是在选择模块是,所有的都选择reinstall,然后再另外搜curl,然后对于其中的curl,是选择安装的:

reinstall curl lib and install curl

然后由于是reinstall,而之前已经安装好的模块,本地都已经有文件了,所以是瞬间下载好了:

quick download ok

结果,又还是去下载很多其他模块了。

所以,再次取消掉。

这次重新再弄一次,选择的是,download without installing,然后选择模块是,只选择curl,并且选择的是keep,结果还是会去下载很多其他的模块。

 

所以,还是放弃此法。

5换用另外那种,直接去:

http://mirrors.xmission.com/cygwin/release/curl/

下载对应的curl-7.27.0-1.tar.bz2,然后本地直接解压,得到一个usr文件夹,其下有

bin\curl.exe

share\doc\xxx

share\man\xxx

所以,直接全部拷贝到cygwin的usr文件夹:

E:\dev_install_root\cygwin\usr

下面,即可。

只不过此处悲催的,又是遇到一堆权限问题,但是后来还是慢慢的解决了。

5.然后再去重新打开cygwin窗口,验证是否可以找到crul了。

结果还是没有找到。

所以,看来是cygwin没有把/usr/bin加到其path中,此点也是很奇怪的。

不过懒得管了,干脆手动再次把/usr/bin下的curl.exe移至/bin下面即可。

终于,cygwin中可以找到curl了:

Administrator@NYBDHB7EB3XEHP6 ~
$ curl --help
Usage: curl [options...] <url>
Options: (H) means HTTP/HTTPS only, (F) means FTP only
     --anyauth       Pick "any" authentication method (H)
 -a, --append        Append to target file when uploading (F/SFTP)
     --basic         Use HTTP Basic Authentication (H)
     --cacert FILE   CA certificate to verify peer against (SSL)
     --capath DIR    CA directory to verify peer against (SSL)
 -E, --cert CERT[:PASSWD] Client certificate file and password (SSL)
     --cert-type TYPE Certificate file type (DER/PEM/ENG) (SSL)
     --ciphers LIST  SSL ciphers to use (SSL)
     --compressed    Request compressed response (using deflate or gzip)
 -K, --config FILE   Specify which config file to read
     --connect-timeout SECONDS  Maximum time allowed for connection
 -C, --continue-at OFFSET  Resumed transfer offset
 -b, --cookie STRING/FILE  String or file to read cookies from (H)
 -c, --cookie-jar FILE  Write cookies to this file after operation (H)
     --create-dirs   Create necessary local directory hierarchy
     --crlf          Convert LF to CRLF in upload
     --crlfile FILE  Get a CRL list in PEM format from the given file
......

【总结】

其实,想要在cygwin中安装单个模块,工具等,直接可以从网上找cygwin的景象,比如:

http://mirrors.xmission.com/cygwin/release/

其中curl的地址是:

http://mirrors.xmission.com/cygwin/release/curl/

然后手动下载对应的工具,解压,放到对应的bin或sbin等路径下即可。

转载请注明:在路上 » 【记录】给Cygwin重新安装curl

与本文相关的文章

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (2)

  1. cygwin net下选择curl。安装...。over ,curl --help ...ok
    william10年前 (2014-02-27)回复
86 queries in 0.186 seconds, using 22.28MB memory