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

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

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

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, 테스트, 불안정)을 추가하여 특정 릴리스의 버전을 선택할 수 있습니다. 또한 요청을 충족하는 데 필요한 경우 이 패키지의 종속성에 대한 이 릴리스의 버전을 선택합니다.

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

관련 정보