How to install Gtop on Ubuntu 17.04

To install Gtop on Ubuntu 17.04

Gtop is a system monitoring tool which reads information about processes and the states of the system in dynamic mode. It contains some views to monitor the CPU, memory, swap space, disk and network usage with a percentage and graphical representation in the system. This tutorial covers the installation procedure of Gtop on Ubuntu 17.04.

Pre - Requisite

- Node.js

- npm

Node.js

Node.js is a platform built on Chrome' s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

npm

npm short for Node Package Manager is an online repository for the publishing of open-source Node.js projects. It is a command-line utility for interacting with said repository that aids in package installation, version management, and dependency management.

Installation procedure

To start the installation procedure, install the Node.js legacy package by running the following command.

root@linuxhelp:~# apt install nodejs-legacy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libuv1 nodejs
The following NEW packages will be installed:
  libuv1 nodejs nodejs-legacy
0 upgraded, 3 newly installed, 0 to remove and 246 not upgraded.
Need to get 3,416 kB of archives.
.
.
.
Processing 1 added doc-base file...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up nodejs (4.7.2~dfsg-1ubuntu3) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Setting up nodejs-legacy (4.7.2~dfsg-1ubuntu3) ...

The node.js legacy package is installed. Next install the npm package in the target system by executing the following command.

root@linuxhelp:~# apt install npm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gyp javascript-common libjs-inherits libjs-jquery libjs-node-uuid
  libjs-underscore libssl-dev libssl-doc libssl1.0-dev libssl1.0.0 libuv1-dev
  node-abbrev node-ansi node-ansi-color-table node-archy node-async
.
.
.
Setting up node-fstream (1.0.10-1) ...
Setting up node-fstream-ignore (0.0.6-2) ...
Setting up node-tar (2.2.1-1) ...
Setting up node-gyp (3.4.0-1) ...
Setting up npm (3.5.2-0ubuntu4) ...

The npm and node.js package are installed in the target system. Install the gtop by executing the following command.

root@linuxhelp:~# npm install gtop -g
/usr/local/bin/gtop ->  /usr/local/lib/node_modules/gtop/bin/gtop
/usr/local/lib
`-- gtop@0.1.5
  +-- blessed@0.1.81
  +-- blessed-contrib@4.8.5
.
.
.
| |   `-- abbrev@1.1.0
  | +-- strip-ansi@3.0.1
  | | `-- ansi-regex@2.1.1
  | +-- term-canvas@0.0.5
  | `-- x256@0.0.2
  `-- systeminformation@3.26.2

The Gtop package is installed in the target system. The gtop application can be run by clicking the icon in the ubuntu dashboard. The Gtop shows the details related to the CPU history and Memory history.


The Gtop application is running successfully in the Ubuntu dashboard.

FAQ
Q
How to set the environment variable for gtop?
A
Run the following command to set environment variable for gtop



$ LANG=en_US.utf8 TERM=xterm-256color gtop
Q
How to install Gtop on fedora?
A
To install Gtop on fedora, use followings steps

$ curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
$ sudo dnf -y install nodejs
$ sudo npm install gtop -g
Q
How to use Gtop?
A
Start gtop with the gtop command
$ gtop
To stop gtop use q, or ctrl+c in most shell environments.
You can sort the process table by pressing
• p: Process Id
• c: CPU usage
• m: Memory usage
Q
What is the requirements for gtop ?
A
you will need the following requirements, Linux / OSX / Windows Node.js >= v4
Q
what are the alternative commands like gtop?
A
Here I have to give some of the alternative for gtop are
htop,
glances,
nmon,
vtop".