Ubuntu | Remove sendmail completely

Problem: I installed sendmail in my ubuntu system with the help of link http://lukepeters.me/blog/getting-the-php-mail-function-to-work-on-ubuntu. I installed it to test php mail functionality on localhost for my project. It was working slow, therefore, after testing, I wanted to uninstall it completely from system. Let’s see How to Completely Remove/Uninstall sendmail from ubuntu.

Solution: Initially, I tried following sequence of commands on terminal to remove sendmail as various or most of the website links have suggested following commands for uninstalling sendmail on ubuntu:

sudo apt-get remove sendmail
sudo apt-get remove --auto-remove sendmail
sudo apt-get purge sendmail

But with these sequence of commands, sendmail was not removed from system and php mail() function continued to send mails.

When I appended * everywhere in above sequence of commands, then sendmail gets completely removed/uninstalled from system:

sudo apt-get remove sendmail*			// uninstall sendmail
sudo apt-get remove --auto-remove sendmail*	//uninstall sendmail and its dependencies
sudo apt-get purge sendmail*			//removing local/config files for sendmail

Leave a Reply

Your email address will not be published. Required fields are marked *