데비안 불스아이에 특정 버전의 NGinx 설치

데비안 불스아이에 특정 버전의 NGinx 설치

다음 Dockerfile을 사용하여 Docker 컨테이너를 구축하고 있습니다.

FROM debian:bullseye
RUN apt -y update && echo 'deb https://nginx.org/packages/debian/ bullseye nginx' >> /etc/apt/sources.list && echo 'deb-src https://nginx.org/packages/debian/ bullseye nginx' >> /etc/apt/sources.list && apt -y install gnupg2 && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ABF5BD827BD9BF62 && apt -y update && apt -y install nginx nginx-extras luarocks
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
        && ln -sf /dev/stderr /var/log/nginx/error.log
# RUN luarocks install nginx-lua-prometheus
EXPOSE 80

STOPSIGNAL SIGTERM

NGinx 웹사이트의 지침에 따라 다음 두 줄을 추가했습니다 etc/apt/sources.list.

deb https://nginx.org/packages/debian/ bullseye nginx
deb-src https://nginx.org/packages/debian/ bullseye nginx

설치를 시작합니다.apt install -y nginx ...

그러나 컨테이너가 시작되면오래된버전이 실행 중입니다:

# nginx -v
nginx version: nginx/1.18.0

nginx는 NGinx 저장소가 아닌 debian 저장소에서 설치된 것 같습니다.

더욱 놀라운 점은 NGinx 패키지가 업그레이드 가능으로 표시되어 있다는 것입니다.

# apt update
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Hit:4 https://nginx.org/packages/debian bullseye InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.

# apt list --upgradable
Listing... Done
nginx/stable 1.20.1-1~bullseye all [upgradable from: 1.18.0-6.1]
N: There is 1 additional version. Please use the '-a' switch to see it

이제 nginx 패키지를 업그레이드하려고 하면 실패합니다.

# apt upgrade nginx
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
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:
 libnginx-mod-http-auth-pam : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-cache-purge : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-dav-ext : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-echo : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-fancyindex : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-geoip : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-geoip2 : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-headers-more-filter : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-image-filter : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-lua : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-ndk : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-perl : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-subs-filter : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-uploadprogress : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-upstream-fair : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-http-xslt-filter : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-mail : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-nchan : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-stream : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-stream-geoip : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 libnginx-mod-stream-geoip2 : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
 nginx-extras : Depends: nginx-common (= 1.18.0-6.1) but it is not installable
E: Broken packages

내 질문은 다음과 같습니다. NGinx 저장소에서 직접 최신 버전(nginx/stable 1.20.1)을 어떻게 설치할 수 있습니까?

답변1

에서 man apt:

등호(=)가 포함된 패키지 이름과 선택하려는 패키지 버전을 따라 특정 버전의 패키지를 설치하도록 선택할 수 있습니다. 또는 슬래시(/)와 코드명(buster, Bullseye, sid...) 또는 제품군 이름(stable, Testing, Unstable)이 포함된 패키지 이름을 따라 특정 배포판에 대한 버전을 선택할 수 있습니다. 요청을 충족하는 데 필요한 경우 이 버전에서 패키지 종속성 버전도 선택됩니다.

패키지의 종속성에 문제가 있을 수도 있지만 nginx/stable 1.20.1설치를 시도하면 알게 될 것입니다.

관련 정보