How To Install libnet-smtp-server-perl on Ubuntu 18.04

In this tutorial we learn how to install libnet-smtp-server-perl on Ubuntu 18.04. libnet-smtp-server-perl is native Perl SMTP Server implementation for Perl

Introduction

In this tutorial we learn how to install libnet-smtp-server-perl on Ubuntu 18.04.

What is libnet-smtp-server-perl

libnet-smtp-server-perl is:

The Net::SMTP::Server module implements an RFC 821 compliant SMTP server, completely in Perl. It’s extremely extensible, so adding in things like spam filtering, or more advanced routing and handling features can be easily handled. An additional module, Net::SMTP::Server::Relay has also been implemented as an example of just one application of this extensibility. See the pod for more details on that module. This extension has been tested on both Unix and Win32 platforms.

Creating a new server is as trivial as:

$server = new Net::SMTP::Server($host, $port);

This creates a new SMTP::Server. Both $host and $port are optional, and default to the current hostname and the standard SMTP port (25). However, if you run on a multi-homed machine, you may want to explicitly specify which interface to bind to.

There are three methods to install libnet-smtp-server-perl on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libnet-smtp-server-perl Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libnet-smtp-server-perl using apt-get by running the following command:

sudo apt-get -y install libnet-smtp-server-perl

Install libnet-smtp-server-perl Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libnet-smtp-server-perl using apt by running the following command:

sudo apt -y install libnet-smtp-server-perl

Install libnet-smtp-server-perl Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libnet-smtp-server-perl using aptitude by running the following command:

sudo aptitude -y install libnet-smtp-server-perl

How To Uninstall libnet-smtp-server-perl on Ubuntu 18.04

To uninstall only the libnet-smtp-server-perl package we can use the following command:

sudo apt-get remove libnet-smtp-server-perl

Uninstall libnet-smtp-server-perl And Its Dependencies

To uninstall libnet-smtp-server-perl and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove libnet-smtp-server-perl

Remove libnet-smtp-server-perl Configurations and Data

To remove libnet-smtp-server-perl configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libnet-smtp-server-perl

Remove libnet-smtp-server-perl configuration, data, and all of its dependencies

We can use the following command to remove libnet-smtp-server-perl configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libnet-smtp-server-perl

References

Summary

In this tutorial we learn how to install libnet-smtp-server-perl package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.