給Cygwin重新安裝curl


之前已經安裝過了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相關的內容:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@ 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 findcurl.exe in the local /usr/bin folder and put it into my /bin folder ofc:\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了:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 提示 沒有cywmetalink-3.dll找到模塊

網易鏡像
http://mirrors.163.com/cygwin/ 
32位
http://mirrors.xmission.com/cygwin/x86/release/curl/ 
下載對應的curl,然后本地直接解壓,得到一個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了:

?
   
【總結】

其實,想要在cygwin中安裝單個模塊,工具等,直接可以從網上找cygwin的景象,比如:

32位
http://mirrors.xmission.com/cygwin/x86/ 
其中curl的地址是:

32位
http://mirrors.xmission.com/cygwin/x86/release/curl/<a< a="">href="http://mirrors.xmission.com/cygwin/release/curl/" target=_blank>

然后手動下載對應的工具,解壓,放到對應的bin或sbin等路徑下即可。

================================================

提示 沒有cywmetalink-3.dll

分析后得出 模塊名是metalink 找到模塊
http://mirrors.163.com/cygwin/x86/release/libmetalink/libmetalink3/ 
$ curl

D:/cygwin/bin/curl.exe: error while loading shared libraries: cygcurl-4.dll: cannot open shared object file: No such file or directory
http://mirrors.163.com/cygwin/x86/release/curl/libcurl4/ 
下載安裝即可

==============================================

解決Cygwin “error while loading shared libraries”

日期: 2013-02-28 作者: Gamepader 分類:  ARM_Linux 標簽:  CygwinLinux愛折騰 
評論:  0 超過100人圍觀

今天在網易源安裝了最新版的Cygwin,剛剛在Cygwin下執行curl的時候,出現如下提示信息

1 $curl: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
解決辦法:

第一步.使用cygcheck檢查:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53
$cygcheck curl

C:\Dell\Cygwin\bin\curl.exe

C:\Dell\Cygwin\bin\cygcurl-4.dll

C:\Dell\Cygwin\bin\cyggcc_s-1.dll

C:\Dell\Cygwin\bin\cygwin1.dll

C:\Windows\system32\KERNEL32.dll

C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll

C:\Windows\system32\ntdll.dll

C:\Windows\system32\KERNELBASE.dll

C:\Windows\system32\API-MS-Win-Core-ProcessThreads-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-Heap-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-Memory-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-Handle-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-Synch-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-File-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-IO-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-ThreadPool-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-LibraryLoader-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-NamedPipe-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-Misc-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-SysInfo-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-Localization-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-ProcessEnvironment-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-String-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-Debug-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-ErrorHandling-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-Fibers-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-Util-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Core-Profile-L1-1-0.dll

C:\Windows\system32\API-MS-Win-Security-Base-L1-1-0.dll

C:\Dell\Cygwin\bin\cygcrypto-1.0.0.dll

C:\Dell\Cygwin\bin\cygz.dll

C:\Dell\Cygwin\bin\cyggssapi-3.dll

C:\Dell\Cygwin\bin\cygheimntlm-0.dll

C:\Dell\Cygwin\bin\cygkrb5-26.dll

C:\Dell\Cygwin\bin\cygasn1-8.dll

C:\Dell\Cygwin\bin\cygroken-18.dll

C:\Dell\Cygwin\bin\cygcrypt-0.dll

C:\Dell\Cygwin\bin\cygcom_err-2.dll

C:\Dell\Cygwin\bin\cygwind-0.dll

C:\Dell\Cygwin\bin\cyghx509-5.dll

C:\Dell\Cygwin\bin\cygintl-8.dll

C:\Dell\Cygwin\bin\cygiconv-2.dll

C:\Dell\Cygwin\bin\cygsqlite3-0.dll

C:\Dell\Cygwin\bin\cygheimbase-1.dll

C:\Dell\Cygwin\bin\cygidn-11.dll

C:\Dell\Cygwin\bin\cyglber-2-4-2.dll

C:\Dell\Cygwin\bin\cygldap-2-4-2.dll

C:\Dell\Cygwin\bin\cygssl-1.0.0.dll

C:\Dell\Cygwin\bin\cygssh2-1.dll

C:\Dell\Cygwin\bin\cygmetalink-3.dll

C:\Dell\Cygwin\bin\cygexpat-1.dll

cygcheck: track_down: could not find cygsasl2-2.dll
發現是缺少了cygsasl2-2.dll

第二步.分析丟失的模塊並安裝:

有文件名分析丟失的模塊名字應該為cygsasl2,當然也有可能是cygsasl,cyg,sasl2等,一個個都使用Cygwin的Setup.exe安裝上,發現丟失的模塊名字應該是sasl2,點選install,問題解決
http://mirrors.163.com/cygwin/

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM