當 apt-get 在 Ubuntu 16.04.4 LTS 上無法正確安裝時,如何在 Ubuntu 中安裝curl?

當 apt-get 在 Ubuntu 16.04.4 LTS 上無法正確安裝時,如何在 Ubuntu 中安裝curl?

我在Ubuntu 16.04.4 LTS 上的curl 無法工作(它說任何https 網站上都存在證書問題,但我的作業系統證書很好...我可以在瀏覽器中很好地訪問相同的網站。甚至嘗試匯出工作瀏覽器的憑證和curl仍然不起作用)。 apt-get 說curl 是最新的。顯然不是。於是我就進入了curl頁面: https://curl.se/docs/install.html。它說使用 vcpkg。問題是,vcpkg 需要curl!

以下是 vcpkg 安裝失敗的日誌:

-- Downloading https://www.openssl.org/source/openssl-3.0.3.tar.gz -> openssl-3.0.3.tar.gz...
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'manifests' = off
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] 31607: popen(curl --fail -L https://www.openssl.org/source/openssl-3.0.3.tar.gz --create-dirs --output /root/rclone/vcpkg/downloads/openssl-3.0.3.tar.gz.31607.part 2
>&1)
[DEBUG] 31607: cmd_execute_and_stream_data() returned 60 after   394329 us
Error: Failed to download from mirror set:
https://www.openssl.org/source/openssl-3.0.3.tar.gz:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
^M  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0^M  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

所以這似乎是一個死胡同。我還能怎樣獲得捲曲?

如果有幫助,這是curl我的(來自apt-get

curl --version
curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets 

和系統資訊:

uname -a
Linux moxie 4.15.0-142-generic #146~16.04.1-Ubuntu SMP Tue Apr 13 09:27:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial

相關內容