No se pudo detener postfix.service: la unidad postfix.service no se cargó

No se pudo detener postfix.service: la unidad postfix.service no se cargó

Cuando intento eliminar postfixme sale este error:

Removing postfix (3.1.0-3) ...
Failed to stop postfix.service: Unit postfix.service not loaded.
invoke-rc.d: initscript postfix, action "stop" failed.
dpkg: error processing package postfix (--remove):
 subprocess installed pre-removal script returned error exit status 5
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Errors were encountered while processing:
 postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)

Respuesta1

La razón fue porque /etc/init.d/postfixno existía.

Creé un /etc/init.d/postfixarchivo en blanco y lo hice ejecutable usando sudo chmod +x /etc/init.d/postfix, luego el problema se resolvió.

Respuesta2

Esto funcionó para mí:

Después de crear un archivo postfix, ejecute este comando:

sudo apt-get purge postfix 

Y luego reinstale postfix:

sudo apt-get --reinstall install postfix

información relacionada