Introduction to Installing htop on CentOS 7
Many sysadmins know about top, the standard process management and activity monitor that comes on most Linux systems. But there are times when top does not provide the information you’re really looking for, or you want something that updates more frequently as the state of your system changes.
Look no further than htop. It’s interactive, real-time, and sports a variety of metrics and details above and beyond what top provides.
You can see CPU utilization at a glance, and that’s just the tip of the iceberg. Sort processes, kill rogue jobs right from htop, and set priorities. To learn more about htop, see the htop website.
Prerequisites to Installing htop on CentOS 7
A CentOS 7 machine
Basic knowledge of Linux and how to use the shell
Installing htop on CentOS 7: Two Methods
There are two different ways you can get htop on your computer. First, you can install it as a binary from your package manager (on CentOS this would be yum). This is a good option if you want to get it right away and don’t much mind what version of htop you’re getting.
You can also install htop from source. Since htop is open-source, you can download the code and build it yourself on your system. This takes a little longer, but you can be sure you’re getting the most updated build available (important if you’re looking for a specific new feature).
We’ll go through both methods step by step
Install htop with Yum
The yum package manager does not contain htop by default. This is okay; we just need to add an EPEL repository so yum can find it. Here’s the commands to add that repository:
yum -y install epel-release
yum -y update
Now with the repository properly added, you can tell yum to install the htop process monitoring tool:
yum -y install htop