Installing htop on a CentOS VPS

Please contact us if you need support - we're here to help!


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).


Article Name: Installing htop on a CentOS VPS
Author:

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read








Knowledgebase

Search our Knowledgebase