종속성이 충족되지 않아 Debian 9stretch에 apt-transport-https를 설치할 수 없습니다: apt (>= 1.5~alpha4)

종속성이 충족되지 않아 Debian 9stretch에 apt-transport-https를 설치할 수 없습니다: apt (>= 1.5~alpha4)

CI/CD 파이프라인에 Dockerfile이 구축되어 있습니다. Debian 9 Stretch 기반 Drupal 이미지로 시작하여 Node 10을 설치합니다. 빌드 이미지는 지난 3년 동안 작동했지만 어제 작동이 중단되었습니다.

문제를 재현하려면 Dockerfile의 지침 없이 컨테이너를 실행할 수 있습니다.

docker run -it drupal:8.6.1-apache bash

그런 다음 Node 10을 설치해야 하는 컨테이너에서 이 스크립트를 실행합니다.

curl -fsSL https://deb.nodesource.com/setup_10.x | bash -

을(를) 설치하는 동안 스크립트가 실패했습니다 apt-transport-https. 직접 설치하려고 하면 다음과 같은 오류가 표시됩니다.

apt-get update && apt-get install -y apt-transport-https
...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 apt-transport-https : Depends: apt (>= 1.5~alpha4) but 1.4.8 is to be installed
E: Unable to correct problems, you have held broken packages.

특정 버전을 설치하기 위해 이 명령을 실행하려고 하면 다음과 같습니다.

apt-get install -y apt=1.5~alpha4
...
E: Version '1.5~alpha4' for 'apt' was not found

사용 가능한 버전 목록을 보기 위해 이것을 실행하면 다음과 같습니다 apt.

apt list -a apt
...
apt/stable-updates 1.8.2.3 amd64 [upgradable from: 1.4.8]
apt/stable,stable 1.8.2.2 amd64
apt/oldstable 1.4.11 amd64
apt/oldstable 1.4.10 amd64
apt/now 1.4.8 amd64 [installed,upgradable to: 1.8.2.3]

그렇다면 내가:

apt-get install -y apt=1.8.2.3
...
The following packages have unmet dependencies:
 apt : Depends: libapt-pkg5.0 (>= 1.7.0~alpha3~) but 1.4.8 is to be installed
       Depends: libgnutls30 (>= 3.6.6) but 3.5.8-5+deb9u5 is to be installed
E: Unable to correct problems, you have held broken packages.

그런 다음 필요한 버전을 설치하려고 하면 다음과 같습니다 libapt-pkg5.0.

The following packages have unmet dependencies:
 libapt-pkg5.0 : Depends: libc6 (>= 2.27) but 2.24-11+deb9u4 is to be installed
                 Depends: libzstd1 (>= 1.3.2) but 1.1.2-1+deb9u1 is to be installed
                 Breaks: apt (< 1.6~) but 1.4.8 is to be installed
                 Recommends: apt (>= 1.8.2.3) but 1.4.8 is to be installed

그런 다음 실행하면:

apt-get install -y libzstd1=1.3.8+dfsg-3+deb10u2 # this seems to install fine
apt-get install -y libc6=2.28-10

다음과 같은 경우 설치가 libc6실패합니다.

Reading package lists... 0%
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-libc-dev
Use 'apt autoremove' to remove it.
Suggested packages:
  glibc-doc libc-l10n locales
Recommended packages:
  libidn2-0
The following packages will be upgraded:
  libc6
1 upgraded, 0 newly installed, 0 to remove and 57 not upgraded.
Need to get 2867 kB of archives.
After this operation, 1693 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 libc6 amd64 2.28-10 [2867 kB]
Fetched 2867 kB in 1s (1858 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)

이 시점에서 나는 이 문제를 해결하는 데 몇 시간을 보냈으며 이 방향으로 계속할 가치가 있는지 또는 이 문제를 해결할 다른 방법이 있는지 궁금합니다.

aptitude다음과 같이 새 컨테이너의 모든 종속성을 충족 할 수 있었습니다 .

apt-get update
apt-get install -y aptitude
aptitude install apt-transport-https

그것은 나에게 물었다:

The following NEW packages will be installed:
  apt-transport-https libseccomp2{a}
The following packages will be upgraded:
  apt{b} libapt-pkg5.0{b}
2 packages upgraded, 2 newly installed, 0 to remove and 59 not upgraded.
Need to get 2575 kB of archives. After unpacking 1189 kB will be used.
The following packages have unmet dependencies:
 apt : Depends: libgnutls30 (>= 3.6.6) but 3.5.8-5+deb9u3 is installed and it is kept back
       Breaks: aptitude (< 0.8.10) but 0.8.7-1 is installed
 libapt-pkg5.0 : Depends: libc6 (>= 2.27) but 2.24-11+deb9u3 is installed and it is kept back
                 Depends: libzstd1 (>= 1.3.2) but it is not going to be installed
                 Breaks: aptitude (< 0.8.9) but 0.8.7-1 is installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     apt [1.4.8 (now)]
2)     apt-transport-https [Not Installed]
3)     libapt-pkg5.0 [1.4.8 (now)]



Accept this solution? [Y/n/q/?]

이 솔루션은 아무 작업도 수행하지 않지만 입력하면 n다음과 같은 질문이 표시됩니다.

The following actions will resolve these dependencies:

      Install the following packages:
1)      libboost-iostreams1.67.0 [1.67.0-13+deb10u1 (stable)]
2)      libboost-system1.67.0 [1.67.0-13+deb10u1 (stable)]
3)      libgpm2 [1.20.4-6.2+b1 (oldstable)]
4)      libncursesw6 [6.1+20181013-2+deb10u2 (stable)]
5)      libtinfo6 [6.1+20181013-2+deb10u2 (stable)]
6)      libunistring2 [0.9.10-1 (stable)]
7)      libzstd1 [1.3.8+dfsg-3+deb10u2 (stable)]

      Upgrade the following packages:
8)      aptitude [0.8.7-1 (now, oldstable) -> 0.8.11-7 (stable)]
9)      aptitude-common [0.8.7-1 (now, oldstable) -> 0.8.11-7 (stable)]
10)     libc-bin [2.24-11+deb9u3 (now) -> 2.28-10 (stable)]
11)     libc-dev-bin [2.24-11+deb9u3 (now) -> 2.28-10 (stable)]
12)     libc6 [2.24-11+deb9u3 (now) -> 2.28-10 (stable)]
13)     libc6-dev [2.24-11+deb9u3 (now) -> 2.28-10 (stable)]
14)     libcwidget3v5 [0.5.17-4+b1 (now, oldstable) -> 0.5.17-11 (stable)]
15)     libgnutls30 [3.5.8-5+deb9u3 (now) -> 3.6.7-4+deb10u4 (stable)]
16)     libhogweed4 [3.3-1+b2 (now, oldstable) -> 3.4.1-1 (stable)]
17)     libidn2-0 [0.16-1+deb9u1 (now, oldstable) -> 2.0.5-1+deb10u1 (stable)]
18)     libnettle6 [3.3-1+b2 (now, oldstable) -> 3.4.1-1 (stable)]
19)     libp11-kit0 [0.23.3-2 (now, oldstable) -> 0.23.15-2+deb10u1 (stable)]
20)     libtasn1-6 [4.10-1.1+deb9u1 (now, oldstable) -> 4.13-3 (stable)]
21)     libxapian30 [1.4.3-2+deb9u3 (now, oldstable) -> 1.4.11-1 (stable)]

Accept this solution? [Y/n/q/?]

이 솔루션을 수락하면 작동합니다. 성공적으로 설치되었으므로 스크립트를 apt-transport-https실행하여 Node.js를 설치할 수 있습니다. 그러나 이는 한 번, 두 번 curl -fsSL https://deb.nodesource.com/setup_10.x | bash -입력해야 하는 대화형 솔루션이므로 Docker 빌드 중에 이 작업이 자동으로 수행되는 방법을 찾을 수 없습니다.ny

답변1

이미지는 busterDebian 10()의 패키지는 거부하지만 최신( buster-updates)의 패키지는 거부하도록 구성되어 있으므로 결국 apt-transport-https후자에서 가져오려고 시도하게 됩니다. 이 문제를 해결하려면 /etc/apt/preferences.d/argon2-buster다음과 같이 편집하세요.

Package: *
Pin: release n=buster*
Pin-Priority: -10

Package: libargon2*
Pin: release n=buster
Pin-Priority: 990

*첫 번째 이후에 추가되었습니다 buster. 이렇게 하면 apt-transport-https문제 없이 설치할 수 있습니다.

다음 명령을 사용하여 이를 자동화할 수 있습니다.

sed -i '2,2s/buster/buster*/' /etc/apt/preferences.d/argon2-buster

답변2

제 경우에는 php:7.2.15-apache-stretch. 스크립트가 apt-transport-https version= 설치를 시도하고 있음을 발견했습니다 1.4.11.

그런데 이 문제가 발생하기 전에 빌드된 컨테이너 내부에서 실행해 apt apt-transport-https -v보니 버전이 1.4.10.

노드 컬 전에 설치를 추가했습니다.

FROM php:7.2.15-apache-stretch
...
RUN apt-get update
...
RUN apt-get install -y apt-transport-https=1.4.10
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash -

관련 정보