エラー:httpsをサポートするには、libcurl> = 7.28.0ライブラリとヘッダが必要です。

エラー:httpsをサポートするには、libcurl> = 7.28.0ライブラリとヘッダが必要です。

このように長い質問を書いて申し訳ありませんが、似たような質問を何回も受け取ったのかと思えばもう少しコンテキストを提供しなければならないようです。


私のシステムではわかります。 。 。

checking for curl-config... /usr/bin/curl-config
checking libcurl version ... 8.2.1
checking curl/curl.h usability... yes
checking curl/curl.h presence... yes
checking for curl/curl.h... yes
checking if libcurl is version 7 and >= 7.28.0... 
configure: error: libcurl >= 7.28.0 library and headers are required with support for https

Rをインストールしようとしたとき(バージョン 4.0.3、これは交渉できません)と./configure --prefix=/opt/R/ --exec-prefix=/opt/R/ --with-libpth-prefix=/opt/ --without-recommended-packages --with-pcre1 --enable-R-shlib

では、config.log次のことがわかります。

configure:46024: checking for curl-config
configure:46042: found /usr/bin/curl-config
configure:46054: result: /usr/bin/curl-config
configure:46080: checking curl/curl.h usability
configure:46080: gcc -c  -g -O2 -fpic  -I/usr/local/include  conftest.c >&5
configure:46080: $? = 0
configure:46080: result: yes
configure:46080: checking curl/curl.h presence
configure:46080: gcc -E  -I/usr/local/include  conftest.c
configure:46080: $? = 0
configure:46080: result: yes
configure:46080: checking for curl/curl.h
configure:46080: result: yes
configure:46094: checking if libcurl is version 7 and >= 7.28.0
configure:46123: gcc -o conftest  -g -O2 -fpic  -I/usr/local/include  -L/usr/local/lib64 conftest.c -lcurl -lpcre -llzma -lbz2 -lz -lrt -ldl -lm  >&5
configure:46123: $? = 0
configure:46123: ./conftest
configure:46123: $? = 1
configure: program exited with status 1
configure: failed program was:

それから内容がconfdefs.h公開されたとき、次のような内容を見ました。

#include <stdlib.h>
| #include <curl/curl.h>
| int main()
| {
| #ifdef LIBCURL_VERSION_MAJOR
| #if LIBCURL_VERSION_MAJOR > 7
|   exit(1);
| #elif LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 28
|   exit(0);
| #else
|   exit(1);
| #endif
| #else
|   exit(1);
| #endif
| }
| 
configure:46133: result: 
configure:46191: error: libcurl >= 7.28.0 library and headers are required with support for https

複数のウェブサイトで同じエラーについていくつかの質問がありますが、試したソリューションのどれもうまくいきませんでした。

明らかに、複数のバージョンを使用できるためです。 。 。

bash-4.2# yum list curl --showduplicates | head -n 5
Loaded plugins: ovl, priorities
Installed Packages
curl.x86_64                    8.2.1-1.amzn2.0.3                      installed 
Available Packages
curl.x86_64                    7.55.1-8.amzn2.0.1                     amzn2-core
bash-4.2# yum list libcurl --showduplicates | head -n 5
Loaded plugins: ovl, priorities
Installed Packages
libcurl.x86_64                  8.2.1-1.amzn2.0.3                     installed 
Available Packages
libcurl.x86_64                  7.55.1-8.amzn2.0.1                    amzn2-core

。 。 。 (それぞれがあります)最後の試みは、andをダウングレードおよび/または削除しようとしましたが、幸運ではありませんでしcurllibcurl

bash-4.2# yum downgrade libcurl
Loaded plugins: ovl, priorities
amzn2-core                                                                                                                                                                                  | 3.6 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package libcurl.x86_64 0:8.2.1-1.amzn2.0.2 will be a downgrade
---> Package libcurl.x86_64 0:8.2.1-1.amzn2.0.3 will be erased
--> Finished Dependency Resolution
Error: Package: curl-8.2.1-1.amzn2.0.3.x86_64 (installed)
           Requires: libcurl(x86-64) = 8.2.1-1.amzn2.0.3

(出力は続きます)。

私はDockerコンテナで作業しているので、上記の内容を簡単に再現できます。この質問の最後にDockerファイルを残しておきます。

以下は便利なシステム情報だと思います。

bash-4.2# cat /etc/*-release*
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
SUPPORT_END="2025-06-30"
Amazon Linux release 2 (Karoo)
cpe:2.3:o:amazon:amazon_linux:2

誰でもこの問題を解決するのに役立ちますか?


これはDockerfile

FROM amazonlinux:2

RUN yum update -y && \
    yum install -y make zip gzip tar which wget java \
    readline-devel \
    xorg-x11-server-devel libX11-devel libXt-devel \
    libcurl-devel libcurl4-openssl-dev \
    openssl-devel libxml2-devel \
    gcc-c++ gcc-gfortran \
    zlib-devel bzip2 bzip2-libs bzip2-devel xz-devel && \
    yum clean all

RUN mkdir -p /opt/R /opt/bin

RUN mv /usr/bin/which /opt/bin/

WORKDIR /opt
RUN wget https://cran.r-project.org/src/base/R-4/R-4.0.3.tar.gz && \
    tar -xf R-4.0.3.tar.gz && \
    mv R-4.0.3/* /opt/R && \
    rm -rf R-4.0.3.tar.gz R-4.0.3

WORKDIR /opt/R

# RUN ./configure --prefix=/opt/R/ --exec-prefix=/opt/R/ --with-libpth-prefix=/opt/ \
#     --without-recommended-packages --with-pcre1 --enable-R-shlib

CMD ["bash"]

ベストアンサー1

4.0.3を使用してからRプロジェクトは、libcurl7から8にアップグレードしてもAPIまたはABIが中断されないことを確認します。、ビルドをパッチできます。実行する前に、./configure以下を実行してください。

awk '/> 7/ { c = 1 } !/> 7/ && c { print("  exit(0);"); c = 0; next; } 1' configure > configure.new && mv configure.new configure

特にR 4.0.3をビルドする必要がない場合、最も簡単な解決策は4.3.0以上(理想的には4.3.1の現在のバージョン)に切り替えることですlibcurl

おすすめ記事