How to Install and Uninstall ntp Ubuntu 22.04

Updated: September 21, 2022

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. I will show you how to install ntp on Ubuntu 22.04 in this guide.

Prerequisites to install

  • Operating system: Ubuntu 22.04 is needed for ntp to work
  • Privileges: Verify that you can execute the sudo commands line.

Prerequisites to install ntp on Ubuntu 22.04

Install ntp Ubuntu 22.04

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

Install ntp using APT

This is a popular method for installing Ubuntu packages because it’s easy to follow, even if you are a newbie in Linux. Following these steps to get ntp 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 this Linux command:

sudo apt update

Step 2: Start the package installation on Ubuntu 22.04. After updating the system, you can install ntp Ubuntu by pasting this command into the terminal and executing it.

sudo apt -y install ntp

Install ntp 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-get -y install aptitude

After installing, you can now install ntp, just following these steps:

Step 1: Obtain new packages from Ubuntu by updating the APT database. Launch the terminal and enter the following Linux command:

sudo apt-get -y update

Step 2: Start installing the packages on Ubuntu 22.04. After updating, you can install ntp Ubuntu by executing this command in the terminal.

sudo aptitude -y install ntp

Uninstall ntp 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 ntp, can be easily uninstalled by anyone.

This command can be used to uninstall ntp from Ubuntu 22.04 if it was installed using APT or Aptitude.

sudo apt remove --auto-remove ntp

If you want to uninstall ntp and remove its data and dependencies, you can also run the following command:

sudo apt autoremove --purge ntp

Summary

In this tutorial, I showed you ways to install ntp on Ubuntu 22.04 and some ways to uninstall ntp too. If you need any help, don’t hesitate to contact me. I’m very glad to answer them.