How to Install Htop?

How to Install Htop?

Many users use the top command to monitor the processes running on the Linux operating system from the command line and to see the amount of CPU and memory these processes use. In this article, we will learn the  htop application, which has a similar task with the top command but provides easier use.

The first striking change in the htop application is that there is a text graph at the top of the screen showing the usage of all cores, memory, and swap space. This part is much more understandable and useful than the top command.

For the installation of Htop, which can be installed for different operating systems, we will now see how to install some Linux operating systems below.

First, you need to have RHEL 7/6/5 and CentOS 7/6/5 on Htop for the installation process, the Epel repository is installed so we will install it for the system architecture and run the following commands in the relevant distributions to enable it. (32 bit or 64bit)

RHEL / CentOS – 32-bit operating system

For RHEL / CentOS 6

wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

rpm -ihv epel-release-6-8.noarch.rpm

For RHEL / CentOS 5

wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

rpm -ihv epel-release-5-4.noarch.rpm

RHEL / CentOS – on the 64-bit operating system

For RHEL / CentOS 7

wget dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

rpm -ihv epel-release-7-11.noarch.rpm

For RHEL / CentOS 6

wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -ihv epel-release-6-8.noarch.rpm

For RHEL / CentOS 5

wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

rpm -ihv epel-release-5-4.noarch.rpm

Once the EPEL repository is installed, you can use the following yum command to get and install the htop the package as shown.

yum install htop -y

For Fedora OS

Fedora users have the opportunity to install Htop using the Fedora Extras repository by typing the following.

yum install htop

dnf install htop [On Fedora 22+ releases]

For Debian and Ubuntu

To Compile and Install Htop From Source Packages

To install Htop version 2.0.2, you must have Development Tools and Ncurses installed on your system so that we can run the following distribution series on our respective distributions.

For RHEL / CentOS and Fedora

yum groupinstall "Development Tools"
yum install ncurses ncurses-devel
wget http://hisham.hm/htop/releases/2.0.2/htop-2.0.2.tar.gz
tar xvfvz htop-2.0.2.tar.gz
cd htop-2.0.2

For Debian and Ubuntu

sudo apt-get install build-essential 
sudo apt-get install libncurses5-dev libncursesw5-dev
wget http://hisham.hm/htop/releases/2.0.2/htop-2.0.2.tar.gz
tar xvfvz htop-2.0.2.tar.gz
cd htop-2.0.2

Next, we run the config and create the script to install and compile htop.

./configure
make
make install

Now we run the htop monitoring tool by running the following command in the terminal.

htop

A window like the one in the picture below appears.

The best of the htop application is that we can actually navigate the processes by using the up / down arrow keys and we can do different operations with the F keys for these processes.

I hope it has been a useful article.