How To Install node-time-zone on Ubuntu 18.04

In this tutorial we learn how to install node-time-zone on Ubuntu 18.04. node-time-zone is Pretty time zone

Introduction

In this tutorial we learn how to install node-time-zone on Ubuntu 18.04.

What is node-time-zone

node-time-zone is:

This package displays the Coordinated Universal Time of the current time zone. For example if current time zone is Norway then it will show the UTC time. You can also put an arbitrary date in the arguments. This package is a dependency for ava.

Node.js is an event-based server-side JavaScript engine.

There are three methods to install node-time-zone 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 node-time-zone Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install node-time-zone

Install node-time-zone Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install node-time-zone using apt by running the following command:

sudo apt -y install node-time-zone

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

sudo aptitude -y install node-time-zone

How To Uninstall node-time-zone on Ubuntu 18.04

To uninstall only the node-time-zone package we can use the following command:

sudo apt-get remove node-time-zone

Uninstall node-time-zone And Its Dependencies

To uninstall node-time-zone and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove node-time-zone

Remove node-time-zone Configurations and Data

To remove node-time-zone configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge node-time-zone

Remove node-time-zone configuration, data, and all of its dependencies

We can use the following command to remove node-time-zone configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge node-time-zone

References

Summary

In this tutorial we learn how to install node-time-zone package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.