/etc/apt/sources.list는 https 연결이 있는 URL을 허용하지 않습니다.

/etc/apt/sources.list는 https 연결이 있는 URL을 허용하지 않습니다.

Debian Wheezy에서 내 /etc/apt/sources.list파일은 다음과 같습니다:

deb https://mirrors.kernel.org/debian/ wheezy main contrib non-free
deb-src https://mirrors.kernel.org/debian/ wheezy main contrib non-free

deb http://security.debian.org/debian/ wheezy main contrib non-free
deb-src http://security.debian.org/debian/ wheezy main contrib non-free

deb https://mirrors.kernel.org/debian/ wheezy-updates main contrib non-free
deb-src https://mirrors.kernel.org/debian/ wheezy-updates main contrib non-free

다음을 수행하면 sudo apt-get update다음과 같은 오류 메시지가 나타납니다.

E: The method driver /usr/lib/apt/methods/https could not be found

해결책은 무엇입니까?

답변1

이 패키지를 설치해야 합니다apt-transport-https. 패키지를 다운로드하는 대신 패키지를 읽으려면 source.list를 일시적으로 편집해야 할 수도 있습니다 http.https:

답변2

내 문제는 다소 비슷합니다. 내 /etc/apt/sources.list파일에는 https를 읽는 저장소가 없습니다. 그러나 패키지를 설치할 수 없습니다. 명령을 실행할 때 발생하는 오류 sudo apt-get install apt-transport-https는 다음과 같습니다.

Err http://ftp.us.debian.org/debian/ testing/main apt-transport-https amd64 1.0.9.5  404  Not Found [IP: 64.50.236.52 80]
E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/a/apt/apt-transport-https_1.0.9.5_amd64.deb  404  Not Found [IP: 64.50.236.52 80]

오류를 자세히 살펴보면 apt가 오래된 패키지를 가리키는 것 같습니다. 그래서 검색을 통해 수동으로 패키지를 추적했습니다 http://ftp.us.debian.org/debian/pool/main/a/apt/. 거기에서 버전이 apt-transport-https_1.0.9.5_amd64.deb존재하지 않아서 apt가 패키지를 얻을 수 없다는 것을 발견했습니다.

이 문제를 해결하기 위해 apt-transport-https_1.0.9.6_amd64.deb링크에서 다운로드하여 사용했습니다 dpkg -i apt-transport-https*. 이후 실행해 보니 sudo apt-get update잘 작동했습니다.

소스 파일에는 문제가 없지만 apt가 패키지를 얻을 수 없는 경우 패키지를 수동으로 추적하면 해결 방법이 될 수 있습니다.

관련 정보