Installing htop on a CentOS VPS

If you want to install ‘htop’ (a very good Linux process viewer) onto a server running CentOS, you may run into some errors.
 
Firstly, you need to make sure you have the DAG RPM Repository installed.
 
Create a new file:
vi /etc/yum.repos.d/dag.repo
 
containing:
 
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
 
Then you need to add the GPG key for the repository. Run the following command:
 
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
 
Finally, install htop:
 
yum install htop
 
It should update the repository, download the software and install it. Once it’s done, you can run ‘htop’ via the command line. If you’re installing on multiple servers and don’t want to manually reconfigure it every time, you can upload a default settings file.
 
Create/edit the file /root/.htoprc
 
vi /root/.htoprc
 
Add/replace it with the following (this is an example htop configuration):
 
# Beware! This file is rewritten every time htop exits.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 2 46 47 49 1
sort_key=46
sort_direction=1
hide_threads=0
hide_kernel_threads=1
hide_userland_threads=0
shadow_other_users=0
highlight_base_name=1
highlight_megabytes=1
highlight_threads=0
tree_view=0
header_margin=0
detailed_cpu_time=0
color_scheme=0
delay=15
left_meters=CPU Memory Swap
left_meter_modes=1 1 1
right_meters=Tasks LoadAverage Uptime Hostname
right_meter_modes=2 2 2 2
 
Save the file and run htop again (it may delete this file, but it will import the settings).
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How to Check VPS RAM Usage with SSH

There are a few tools built-in to most Linux distros for gauging and fine-tuning your server's...

How to Install CSF on a VPS

  ConfigServer Firewall, or CSF, is a common Linux security suite. Log in to your VPS as the...

How to Configure a Minecraft Server on a CentOS VPS

Once you have your Minecraft template installed and running as you can read more about...

How to Install WHM/cPanel on RHEL or CentOS VPS

  To install cPanel, run the following commands while logged in to your VPS as the root...

Installing GNOME Desktop on CentOS

Installing GNOME Desktop on CentOS is faily straightforward. Most CentOS servers are run on CLI...