postfix.service の停止に失敗しました: ユニット postfix.service がロードされていません

postfix.service の停止に失敗しました: ユニット postfix.service がロードされていません

削除しようとすると、postfix次のエラーが発生します:

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)

答え1

理由は/etc/init.d/postfix存在しなかったからです。

空のファイルを作成し/etc/init.d/postfix、 を使用して実行可能にするsudo chmod +x /etc/init.d/postfixと、問題は解決しました。

答え2

これは私にとってはうまくいきました:

postfix ファイルを作成したら、次のコマンドを実行します。

sudo apt-get purge postfix 

その後、postfixを再インストールします。

sudo apt-get --reinstall install postfix

関連情報