How To Install sntp on Ubuntu 20.04

In this tutorial we learn how to install sntp on Ubuntu 20.04. sntp is Network Time Protocol - sntp client Network Time Protocol - sntp client

Introduction

In this tutorial we learn how to install sntp on Ubuntu 20.04.

What is sntp

sntp is:

NTP, the Network Time Protocol, is used to keep computer clocks accurate by synchronizing them over the Internet or a local network, or by following an accurate hardware receiver that interprets GPS, DCF-77, NIST or similar time signals.

sntp can be used as an SNTP client to query a NTP or SNTP server and either display the time or set the local system’s time. It is not sufficient, however, for maintaining an accurate clock in the long run.

Package: sntp Architecture: amd64 Version: 1:4.2.8p12+dfsg-3ubuntu4 Priority: optional Section: universe/net Source: ntp Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Debian NTP Team [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 215 Depends: libc6 (>= 2.17), libevent-core-2.1-7 (>= 2.1.8-stable), libevent-pthreads-2.1-7 (>= 2.1.8-stable), libopts25 (>= 1:5.18.16), libssl1.1 (>= 1.1.0) Breaks: ntp (« 1:4.2.8p10+dfsg-3+exp3) Replaces: ntp (« 1:4.2.8p10+dfsg-3+exp3) Filename: pool/universe/n/ntp/sntp_4.2.8p12+dfsg-3ubuntu4_amd64.deb Size: 62580 MD5sum: 2dff32695f25e184abe6eb2aa6b447e3 SHA1: db444588ba5448ff22e58584f661160dc60b44c2 SHA256: bb625cdc9caa602c98a84e42b3d71b6e5c0a471efa9729a474893eaa6b03c160 Homepage: http://support.ntp.org/ Description-en: Network Time Protocol - sntp client NTP, the Network Time Protocol, is used to keep computer clocks accurate by synchronizing them over the Internet or a local network, or by following an accurate hardware receiver that interprets GPS, DCF-77, NIST or similar time signals.

sntp can be used as an SNTP client to query a NTP or SNTP server and either display the time or set the local system’s time. It is not sufficient, however, for maintaining an accurate clock in the long run.

There are three methods to install sntp on Ubuntu 20.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 sntp Using apt-get

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

sudo apt-get update

After updating apt database, We can install sntp using apt-get by running the following command:

sudo apt-get -y install sntp

Install sntp Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install sntp using apt by running the following command:

sudo apt -y install sntp

Install sntp 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 sntp using aptitude by running the following command:

sudo aptitude -y install sntp

How To Uninstall sntp on Ubuntu 20.04

To uninstall only the sntp package we can use the following command:

sudo apt-get remove sntp

Uninstall sntp And Its Dependencies

To uninstall sntp and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove sntp

Remove sntp Configurations and Data

To remove sntp configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge sntp

Remove sntp configuration, data, and all of its dependencies

We can use the following command to remove sntp configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge sntp

References

Summary

In this tutorial we learn how to install sntp package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.