Installieren Sie eine bestimmte Version von NGinx auf Debian Bullseye

Installieren Sie eine bestimmte Version von NGinx auf Debian Bullseye

Ich baue einen Docker-Container mit dem folgenden 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

Gemäß den Anweisungen auf der NGinx-Site füge ich die folgenden beiden Zeilen hinzu etc/apt/sources.list:

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

und starten Sie die Installation:apt install -y nginx ...

Wenn der Container jedoch gestartet wird,altVersion läuft:

# nginx -v
nginx version: nginx/1.18.0

Es scheint, dass Nginx aus dem Debian-Repository und nicht aus dem NGinx-Repository installiert wird.

Noch überraschender ist, dass das NGinx-Paket als aktualisierbar gekennzeichnet ist:

# 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

Wenn ich jetzt versuche, das Nginx-Paket zu aktualisieren, schlägt dies fehl:

# 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

Meine Frage ist folgende: Wie installiere ich die neueste Version (nginx/stable 1.20.1) direkt aus dem NGinx-Repository?

Antwort1

Aus man apt:

Sie können eine bestimmte Version eines Pakets zur Installation auswählen, indem Sie dem Paketnamen ein Gleichheitszeichen (=) und die Version des auszuwählenden Pakets folgen lassen. Alternativ können Sie die Version einer bestimmten Version auswählen, indem Sie dem Paketnamen einen Schrägstrich (/) und den Codenamen (Buster, Bullseye, Sid ...) oder den Suite-Namen (Stable, Testing, Unstable) folgen lassen. Dadurch werden auch Versionen dieser Version für Abhängigkeiten dieses Pakets ausgewählt, falls dies zur Erfüllung der Anforderung erforderlich ist.

Möglicherweise gibt es auch Probleme mit den Abhängigkeiten des nginx/stable 1.20.1Pakets, aber Sie werden es herausfinden, wenn Sie versuchen, es zu installieren.

verwandte Informationen