Falha ao parar postfix.service: Unidade postfix.service não carregada

Falha ao parar postfix.service: Unidade postfix.service não carregada

Quando tento remover, postfixrecebo este erro:

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)

Responder1

A razão foi porque /etc/init.d/postfixnão existia.

Criei um /etc/init.d/postfixarquivo em branco e tornei-o executável usando sudo chmod +x /etc/init.d/postfix, então o problema foi resolvido.

Responder2

Isso funcionou para mim:

Depois de criar um arquivo postfix, execute este comando:

sudo apt-get purge postfix 

E então reinstale o postfix:

sudo apt-get --reinstall install postfix

informação relacionada