Limpieza de paquetes rotos en Debian

Ederick Navas

Hola gente una consulta

Estaba haciendo una limpieza de paquetes rotos en Debian 10, y no me dejaba de ninguna manera entonces quité los paquetes del archivo /var/lib/dpkg/status

siguiendo este enlace

este problema se me dió en una instalación algo sencilla, pero no sé que tenia el servidor que me generó problemas al instalar nginx

una vez que hice la reparación de los paquetes rotos

al instalar nginx nuevamente me muestra al final este mensaje

al desempaquetar nginx
Errors were encountered while processing:
/tmp/apt-dpkg-install-vrmvR9/09-nginx-common_1.14.2-2+deb10u1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

alguien sabe que puede ser?

agradezco cualquier sugerencia

Sebastian
cuál comando usaste que te dio ese error? dpkg ? Tiene un modo verbose el comando?

Si quieres me pasas todo lo que escupio el comando por que falta un poco más de información.

probaste con sudo dpkg-reconfigure ?

Ederick Navas

yo purge nginx puesto que la instalación no salió bien, sin embargo cuando ejecutaba el comando apt-get upgrade me mostraba la siguiente salida

The following packages have unmet dependencies:
libnginx-mod-http-auth-pam (ok): Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not installed
libnginx-mod-http-dav-ext (no esta): Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not installed
libnginx-mod-http-echo (ok): Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not installed
libnginx-mod-http-geoip (ok): Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not installed
libnginx-mod-http-image-filter (ok): Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not installed
libnginx-mod-http-subs-filter (ok): Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not installed
libnginx-mod-http-upstream-fair (ok): Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not installed
libnginx-mod-http-xslt-filter (ok): Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not installed
libnginx-mod-mail (ok): Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not installed
libnginx-mod-stream (ok): Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not installed
nginx-full : Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not installed
E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).

ya había eliminado los paquetes de nginx, nginx-full y nginx-common

entonces eliminé esas dependencias del archivo /var/lib/dpkg/status

despues hice una limpieza y actualización de la lista de paquetes apt-get clean & apt-get update

apt-get upgrade

ya no me mostraba el error de las dependencias

entonces instalé nginx con apt-get install nginx

y me mostró la siguiente salida

Preconfiguring packages …
Selecting previously unselected package fonts-dejavu-core.
(Reading database … 32237 files and directories currently installed.)
Preparing to unpack …/00-fonts-dejavu-core_2.37-1_all.deb …
Unpacking fonts-dejavu-core (2.37-1) …
Selecting previously unselected package fontconfig-config.
Preparing to unpack …/01-fontconfig-config_2.13.1-2_all.deb …
Unpacking fontconfig-config (2.13.1-2) …
Selecting previously unselected package libfontconfig1:amd64.
Preparing to unpack …/02-libfontconfig1_2.13.1-2_amd64.deb …
Unpacking libfontconfig1:amd64 (2.13.1-2) …
Selecting previously unselected package libjpeg62-turbo:amd64.
Preparing to unpack …/03-libjpeg62-turbo_1%3a1.5.2-2+b1_amd64.deb …
Unpacking libjpeg62-turbo:amd64 (1:1.5.2-2+b1) …
Selecting previously unselected package libjbig0:amd64.
Preparing to unpack …/04-libjbig0_2.1-3.1+b2_amd64.deb …
Unpacking libjbig0:amd64 (2.1-3.1+b2) …
Selecting previously unselected package libwebp6:amd64.
Preparing to unpack …/05-libwebp6_0.6.1-2_amd64.deb …
Unpacking libwebp6:amd64 (0.6.1-2) …
Selecting previously unselected package libtiff5:amd64.
Preparing to unpack …/06-libtiff5_4.0.10-4_amd64.deb …
Unpacking libtiff5:amd64 (4.0.10-4) …
Selecting previously unselected package libxpm4:amd64.
Preparing to unpack …/07-libxpm4_1%3a3.5.12-1_amd64.deb …
Unpacking libxpm4:amd64 (1:3.5.12-1) …
Selecting previously unselected package libgd3:amd64.
Preparing to unpack …/08-libgd3_2.2.5-5.2_amd64.deb …
Unpacking libgd3:amd64 (2.2.5-5.2) …
Selecting previously unselected package nginx-common.
Preparing to unpack …/09-nginx-common_1.14.2-2+deb10u1_all.deb …
Unpacking nginx-common (1.14.2-2+deb10u1) …
dpkg: error processing archive /tmp/apt-dpkg-install-vrmvR9/09-nginx-common_1.14.2-2+deb10u1_all.deb (–unpack):
unable to stat ‘./var/www’ (which I was about to install): No such device or address
Selecting previously unselected package libnginx-mod-http-auth-pam.
Preparing to unpack …/10-libnginx-mod-http-auth-pam_1.14.2-2+deb10u1_amd64.deb …
Unpacking libnginx-mod-http-auth-pam (1.14.2-2+deb10u1) …
Selecting previously unselected package libxslt1.1:amd64.
Preparing to unpack …/11-libxslt1.1_1.1.32-2.2~deb10u1_amd64.deb …
Unpacking libxslt1.1:amd64 (1.1.32-2.2~deb10u1) …
Selecting previously unselected package libnginx-mod-http-dav-ext.
Preparing to unpack …/12-libnginx-mod-http-dav-ext_1.14.2-2+deb10u1_amd64.deb …
Unpacking libnginx-mod-http-dav-ext (1.14.2-2+deb10u1) …
Selecting previously unselected package libnginx-mod-http-echo.
Preparing to unpack …/13-libnginx-mod-http-echo_1.14.2-2+deb10u1_amd64.deb …
Unpacking libnginx-mod-http-echo (1.14.2-2+deb10u1) …
Selecting previously unselected package libnginx-mod-http-geoip.
Preparing to unpack …/14-libnginx-mod-http-geoip_1.14.2-2+deb10u1_amd64.deb …
Unpacking libnginx-mod-http-geoip (1.14.2-2+deb10u1) …
Selecting previously unselected package libnginx-mod-http-image-filter.
Preparing to unpack …/15-libnginx-mod-http-image-filter_1.14.2-2+deb10u1_amd64.deb …
Unpacking libnginx-mod-http-image-filter (1.14.2-2+deb10u1) …
Selecting previously unselected package libnginx-mod-http-subs-filter.
Preparing to unpack …/16-libnginx-mod-http-subs-filter_1.14.2-2+deb10u1_amd64.deb …
Unpacking libnginx-mod-http-subs-filter (1.14.2-2+deb10u1) …
Selecting previously unselected package libnginx-mod-http-upstream-fair.
Preparing to unpack …/17-libnginx-mod-http-upstream-fair_1.14.2-2+deb10u1_amd64.deb …
Unpacking libnginx-mod-http-upstream-fair (1.14.2-2+deb10u1) …
Selecting previously unselected package libnginx-mod-http-xslt-filter.
Preparing to unpack …/18-libnginx-mod-http-xslt-filter_1.14.2-2+deb10u1_amd64.deb …
Unpacking libnginx-mod-http-xslt-filter (1.14.2-2+deb10u1) …
Selecting previously unselected package libnginx-mod-mail.
Preparing to unpack …/19-libnginx-mod-mail_1.14.2-2+deb10u1_amd64.deb …
Unpacking libnginx-mod-mail (1.14.2-2+deb10u1) …
Selecting previously unselected package libnginx-mod-stream.
Preparin

g to unpack …/20-libnginx-mod-stream_1.14.2-2+deb10u1_amd64.deb …
Unpacking libnginx-mod-stream (1.14.2-2+deb10u1) …
Selecting previously unselected package nginx-full.
Preparing to unpack …/21-nginx-full_1.14.2-2+deb10u1_amd64.deb …
Unpacking nginx-full (1.14.2-2+deb10u1) …
Selecting previously unselected package nginx.
Preparing to unpack …/22-nginx_1.14.2-2+deb10u1_all.deb …
Unpacking nginx (1.14.2-2+deb10u1) …
Errors were encountered while processing:
/tmp/apt-dpkg-install-vrmvR9/09-nginx-common_1.14.2-2+deb10u1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

al dar dpkg-reconfigure nginx me devuelve lo siguiente

/usr/sbin/dpkg-reconfigure: nginx is broken or not fully installed

hay otra cosa que la carpeta www se está mostrando así

[Photo]

traté de borrar

pero no se deja jajaj

rm -rf www
rm: cannot remove ‘www’: Is a directory

cedric

trata usando ls -li , fijate el inode e intenta borrar el directorio según el inode

find -inum {INODE} -delete

o find -inum {INODE} -exec rm -rf -i {} \;

primero podrías hacer un find -inum {INODE} -ls para asegurarte de no terminar borrando todo al carajo jaja

been there, done that

Ederick Navas

no tiene inode

sale con un signo de interrogación “?”

o que pienso es que no se puede hacer la instalación porque la carpeta /var/www está corrupta y no tiene inode

y por eso da error al instalar el nginx por esa carpeta y quedan colgando las dependencias