Cuando intento actualizar mi versión de nginx (instalada desde el repositorio de Debian) a la última versión del repositorio de nginx, fallará porque no puede sobrescribir un archivo que también está en uno de los paquetes antiguos de nginx (ese paquete está a punto de obtenerse). eliminado automáticamente). Esta es la salida de bash al ejecutar el apt install nginx -V
comando:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
geoip-database (20190724-1~bpo10+1)
libgd3 (2.2.5-5.2)
libgeoip1 (1.6.12-3~bpo10+1)
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
libnginx-mod-http-auth-pam (1.14.2-2)
libnginx-mod-http-dav-ext (1.14.2-2)
libnginx-mod-http-echo (1.14.2-2)
libnginx-mod-http-geoip (1.14.2-2)
libnginx-mod-http-image-filter (1.14.2-2)
libnginx-mod-http-subs-filter (1.14.2-2)
libnginx-mod-http-upstream-fair (1.14.2-2)
libnginx-mod-http-xslt-filter (1.14.2-2)
libnginx-mod-mail (1.14.2-2)
libnginx-mod-stream (1.14.2-2)
nginx-common (1.14.2-2)
nginx-full (1.14.2-2)
The following packages will be upgraded:
nginx (1.14.2-2 => 1.16.1-1~buster)
1 upgraded, 0 newly installed, 12 to remove and 0 not upgraded.
Need to get 0 B/850 kB of archives.
After this operation, 291 kB disk space will be freed.
Do you want to continue? [Y/n]
dpkg: libnginx-mod-http-auth-pam: dependency problems, but removing anyway as you requested:
nginx-full depends on libnginx-mod-http-auth-pam (= 1.14.2-2).
(Reading database ... 152770 files and directories currently installed.)
Removing libnginx-mod-http-auth-pam (1.14.2-2) ...
dpkg: nginx-common: dependency problems, but removing anyway as you requested:
nginx-full depends on nginx-common (= 1.14.2-2); however:
Package nginx-common is to be removed.
libnginx-mod-stream depends on nginx-common (= 1.14.2-2).
libnginx-mod-mail depends on nginx-common (= 1.14.2-2).
libnginx-mod-http-xslt-filter depends on nginx-common (= 1.14.2-2).
libnginx-mod-http-upstream-fair depends on nginx-common (= 1.14.2-2).
libnginx-mod-http-subs-filter depends on nginx-common (= 1.14.2-2).
libnginx-mod-http-image-filter depends on nginx-common (= 1.14.2-2).
libnginx-mod-http-geoip depends on nginx-common (= 1.14.2-2).
libnginx-mod-http-echo depends on nginx-common (= 1.14.2-2).
libnginx-mod-http-dav-ext depends on nginx-common (= 1.14.2-2).
Removing nginx-common (1.14.2-2) ...
(Reading database ... 152743 files and directories currently installed.)
Preparing to unpack .../nginx_1.16.1-1~buster_amd64.deb ...
Unpacking nginx (1.16.1-1~buster) over (1.14.2-2) ...
dpkg: error processing archive /var/cache/apt/archives/nginx_1.16.1-1~buster_amd64.deb (--unpack):
trying to overwrite '/usr/sbin/nginx', which is also in package nginx-full 1.14.2-2
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/nginx_1.16.1-1~buster_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Parece que no se trata de desinstalar primero los paquetes antiguos y luego instalar los nuevos. En lugar de eso, desinstala dos paquetes y luego intenta instalar el actualizado. Porque después de probar esta actualización necesito reinstalar nginx-common
y libnginx-mod-http-auth-pam
.
Mi pregunta es: ¿Alguien sabe alguna manera de forzar la nueva instalación ( dist-upgrade
y --with-new-pkgs
no funcionó) o necesito desinstalar esos paquetes manualmente? ¿O simplemente me falta un paso por realizar antes de actualizar?
Respuesta1
No sé si esto sigue siendo relevante, pero tuve un problema similar. Lo que funcionó para mí fue que desinstalé el antiguo nginx:apt remove nginx nginx-common
Luego instalé la nueva versión:apt install nginx
Si su versión actual no funciona, puede arreglarla conapt --fix-broken install
Respuesta2
Utilice este comando. Esto funcionó para mí.
sudo dpkg --purge --force-depends apache2