How to Install or Uninstall msmtp Ubuntu 22.04

Updated: September 10, 2022

msmtp is an SMTP client that can be used to send mails from Mutt and probably other MUAs (mail user agents). It forwards mails to an SMTP server (for example at a free mail provider), which takes care of the final delivery. Using profiles, it can be easily configured to use different SMTP servers with different configurations, which makes it ideal for mobile clients. I will show you how to install msmtp on Ubuntu 22.04 in this tutorial.

Software Requirement

  • Operating system: Ubuntu 22.04 or older Ubuntu versions
  • Privileges: Make sure that you can run the sudo commands line.

Prerequisites to install msmtp on Ubuntu 22.04

Install msmtp Ubuntu 22.04

msmtp is one of the popular ways on Ubuntu now so that this tutorial will show you how to install it in various ways. Choose the one you believe is simple and easy to follow.

Install msmtp using APT

This is one of the most popular methods for installing Ubuntu packages since it is simple to understand, even if you are a Linux novice. Following these steps to install msmtp on your Ubuntu 22.04.

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to download new packages from Ubuntu. Opening the terminal and executing the following Linux command:

sudo apt-get update

Step 2: Start the package installation on Ubuntu 22.04. After updating, you can install msmtp Ubuntu by pasting this command into the terminal and pressing Enter.

sudo apt-get -y install msmtp

Install msmtp using Aptitude

With Aptitude, users can view a list of available packages and manage their installation, upgrade, and removal of packages. If you didn’t install it on Ubuntu, you need to install it by executing this command.

sudo apt -y install aptitude

Then, you can now install msmtp by following these steps:

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to fetch new packages from Ubuntu. Opening the terminal and executing this Linux command:

sudo apt-get update

Step 2: Install the package on Ubuntu 22.04. After updating, you can install msmtp Ubuntu by executing this command in the terminal.

sudo aptitude -y install msmtp

Uninstall msmtp on Ubuntu 22.04

Have you ever thought that uninstalling an application from Ubuntu might be challenging? You’re wrong; any program, not just a msmtp, can be easily uninstalled by anyone.

You can uninstall msmtp on Ubuntu by running this command if you installed it using APT or Aptitude.

sudo apt remove --auto-remove msmtp

You can also execute this command if you want to uninstall msmtp and remove its data and dependencies:

sudo apt autoremove --purge msmtp

Summary

In this tutorial, I showed you ways to install msmtp on Ubuntu 22.04 and some ways to uninstall msmtp too. Please do not hesitate to contact me if you require any assistance. I’m delighted to respond to them.