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:
name=Dag RPM Repository for Red Hat Enterprise Linux
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
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
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).