当 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?

如果有帮助的话,这是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

相关内容