7.4 Remove sendmail

Now we need to remove all of the sendmail RPMs from the machine. Here's how:

    [root@ntbox /root]# rpm -e sendmail sendmail-cf sendmail-doc 
    error: removing these packages would break dependencies: 
    smtpdaemon is needed by fetchmail-5.0.0-1 
    smtpdaemon is needed by mutt-0.95.4us-4 
    smtpdaemon is needed by nmh-0.27-8 
    /usr/bin/newaliases is needed by mailman-1.0rc2-1

Uh-oh, another error. In this case we really do want to force the issue. In all four of the dependency issues listed above the requirement will be replaced when we install the Postfix RPM (we did say that Postfix is a drop-in replacement for sendmail, right?). Here's what we do:

    [root@ntbox /root]# rpm -e sendmail sendmail-cf sendmail-doc --nodeps 
    [root@ntbox /root]#

This time RPM just returned us to the prompt. Good. It means that we've finally gotten done what we needed to do. Now we have one final step to complete. We have to kill sendmail. I know it seems odd that sendmail would still be running after it's been removed but if you were running sendmail in daemon mode it is, in fact, still running off of the binary image in memory. Do this:

    [root@ntbox /root]# ps -aux|grep 'sendmail' 
    root 4211 0.0 0.5 2084 320 ? S Nov04 0:00 sendmail: accepti 
    root 13645 0.0 0.6 1148 388 pts/1 S 13:33 0:00 grep sendmail

There it is... it's process ID 4211. So let's get rid of it. A simple “killall sendmail” will do the job. Now sendmail is well and truly gone from our test machine.