오류: 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.

관련 정보