apt-get install ssmtp

Derek Broughton derek at pointerstop.ca
Fri Sep 11 14:19:31 UTC 2009

Fred Roller wrote:

> Kaushal Shriyan wrote:
>> Hi,
>> I am actually facing the below pastebin issue on all my ubuntu hosts
>> 8.04 (hardy)
>> http://paste.ubuntu.com/268998/
> ...
>  Package exim4-daemon-light which provides mail-transport-agent is to be
> removed.
>  mailx depends on exim4 | mail-transport-agent; however:
>   Package exim4 is not installed.
>   Package mail-transport-agent is not installed.
>   Package exim4-daemon-light which provides mail-transport-agent is to be
>   removed.
> Removing exim4-daemon-light ...
>  * Stopping MTA             /sbin/start-stop-daemon: warning: failed to

Up to here, this is exactly correct.

>  kill 3668: No such process
> invoke-rc.d: initscript exim4, action "stop" failed.

This, however, is a problem.

> dpkg: error processing exim4-daemon-light (--remove):
>  subprocess pre-removal script returned error exit status 3
> ...
> Looks to me like "ssmtp" is:
> a. looking for "exim4" and "mail-transport-agent" and is not bringing them
> in as a dependency.  You could try maunually installing them before
> running the "ssmtp" install.

No, ssmtp (being a simple MTA) _conflicts_ with all other MTAs (they 
_should_ all provide "mail-transport-agent").  So you see warnings that 
mailx will be broken when exim is removed, but in the end it shouldn't be 
because ssmtp will fulfill the dependency when it gets installed.

> b. script looks like it tried stop MTA and assumed it was PID 3668 and
> exited status 3.  Check with: sudo ps aux |grep MTA

That would be "exim":  I'm pretty sure it won't say MTA anywhere.

> and see if a process for MTA comes up.  If it does, what is the PID.  If
> it doesn't you may need to go into the initscript for exim4 and examine
> the stop procedure or insure the MTA is running when you try
> to install "ssmtp" so that it has something to turn off.  

It's clearly a bug in the exim /var/lib/dpkg/info/exim*.prerm scripts.  It 
shouldn't _care_ if the stop fails, as long as it can't find a running exim.  
Just make sure it's not running, and then make sure there's no .pid file for 
exim anywhere under /var/run.  If it still won't uninstall, delete the 
.prerm script.

More information about the ubuntu-users mailing list