欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

libcurl.so.4: no version information available --curl 、pycurl报错已解决

程序员文章站 2022-06-09 17:20:21
...
libcurl.so.4: no version information available 

 

这个报错导致了cURL url 操作失败,pycurl模块导入失败

查找了多方方案后,比如 删除 /usr/local/lib 里的 libcurl.so.4,只留下libcurl.so;

删除软连接 libcurl.4.2.0, 使 libcurl.so 重新指向 libcurl.so.4.3.0;

很遗憾,都不好使。我的curl版本是7.58.0.

curl 7.58.0 (x86_64-pc-linux-gnu) 

/usr/local/lib/ 目录下,只有libcurl.so, libcurl.so.4, libcurl.so.4.5.0.

并且默认前两个都软连接指向 4.5.0.

一番考虑后,把 libcurl.so 删掉了,libcurl.so.4 重新软连接指向 libcurl.so.4.5.0(与原来无变化)

最后,在 https://askubuntu.com/questions/1029273/curl-is-not-working-on-ubuntu-18-04-lts

找到解决方案(**curl** is not working on Ubuntu 18.04 LTS),

This problem is common in multiple packages in ubuntu recent LTS. Preinstalled packages have a possible error in version convention because "18.04" and other strings referencing repo are considering as part of the package version and not reference to the repo.
The workaround is uninstall preinstalled dependency and then reinstall. After that, you can install cURL.

apt remove -y libcurl4
apt install -y libcurl4 curl

然后 curl -O <url> 下载成功!!!curl --version 查看版本信息也不再报错了~~~pycurl模块导入也不报错了~~

libcurl.so.4: no version information available --curl 、pycurl报错已解决

$ curl --version

curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11             libidn2/2.0.4
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy 

libcurl.so.4: no version information available --curl 、pycurl报错已解决