{"id":183,"date":"2017-10-14T19:20:54","date_gmt":"2017-10-14T19:20:54","guid":{"rendered":"http:\/\/cheapwindowsvps.com\/blog\/?p=183"},"modified":"2025-01-20T10:11:50","modified_gmt":"2025-01-20T10:11:50","slug":"how-to-install-htop-on-centos-7","status":"publish","type":"post","link":"https:\/\/cheapwindowsvps.com\/blog\/how-to-install-htop-on-centos-7\/","title":{"rendered":"How to install htop on CentOS 7"},"content":{"rendered":"<h2><span style=\"font-weight: 400;\">Introduction to Installing htop on CentOS 7<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Many sysadmins know about <\/span><i><span style=\"font-weight: 400;\">top<\/span><\/i><span style=\"font-weight: 400;\">, 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\u2019re really looking for, or you want something that updates more frequently as the state of your system changes.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Look no further than htop. It\u2019s interactive, real-time, and sports a variety of metrics and details above and beyond what top provides.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">You can see CPU utilization at a glance, and that\u2019s just the tip of the iceberg. Sort processes, kill rogue jobs right from htop, and set priorities. To learn more about htop, see the <\/span><a href=\"http:\/\/hisham.hm\/htop\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">htop<\/span><\/a><span style=\"font-weight: 400;\"> website. <\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Prerequisites to Installing htop on CentOS 7<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">To install htop on CentOS 7, you\u2019ll need a few things:<\/span><\/p>\n<p>&nbsp;<\/p>\n<ul style=\"list-style-type: circle;\">\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">A CentOS 7 machine<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Basic knowledge of Linux and how to use the shell<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">Installing htop on CentOS 7: Two Methods<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">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\u2019t much mind what version of htop you\u2019re getting. <\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">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\u2019re getting the most updated build available (important if you\u2019re looking for a specific new feature).<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">We\u2019ll go through both methods step by step.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Install htop with Yum<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">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\u2019s the commands to add that repository:<\/span><\/p>\n<p>&nbsp;<\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">yum -y install epel-release<\/span><\/p>\n<p><span style=\"font-weight: 400;\">yum -y update<\/span><\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Now with the repository properly added, you can tell yum to install the htop process monitoring tool:<\/span><\/p>\n<p>&nbsp;<\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">yum -y install htop<\/span><\/p>\n<\/blockquote>\n<p>\n <span style=\"font-weight: 400;\">If the installation completes successfully, you should be able to type <\/span><span style=\"font-weight: 400;\">htop<\/span><span style=\"font-weight: 400;\"> at the command line and see the status of your system.<\/span><\/p>\n<p><a href=\"http:\/\/cheapwindowsvps.com\/blog\/wp-content\/uploads\/2017\/10\/htop-2.0.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-189\" src=\"http:\/\/cheapwindowsvps.com\/blog\/wp-content\/uploads\/2017\/10\/htop-2.0.png\" alt=\"htop\" width=\"1030\" height=\"602\" srcset=\"https:\/\/cheapwindowsvps.com\/blog\/wp-content\/uploads\/2017\/10\/htop-2.0.png 1030w, https:\/\/cheapwindowsvps.com\/blog\/wp-content\/uploads\/2017\/10\/htop-2.0-300x175.png 300w, https:\/\/cheapwindowsvps.com\/blog\/wp-content\/uploads\/2017\/10\/htop-2.0-768x449.png 768w, https:\/\/cheapwindowsvps.com\/blog\/wp-content\/uploads\/2017\/10\/htop-2.0-1024x598.png 1024w\" sizes=\"auto, (max-width: 1030px) 100vw, 1030px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">(source: <\/span><a href=\"https:\/\/hisham.hm\/htop\/index.php?page=screenshots\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">htop screenshots<\/span><\/a><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To learn more about htop\u2019s features and how to customize it, see the <\/span><span style=\"font-weight: 400;\">htop website<\/span><span style=\"font-weight: 400;\"> or <\/span><a href=\"https:\/\/peteris.rocks\/blog\/htop\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">htop explained<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Install htop from Source<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">To ensure you have the most recent version of htop and all the new features, you can install htop from source. This involves downloading the source code and building it on your machine. <\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Installing from source means you need to gather the dependencies yourself. Before we can install htop, we\u2019ll need <\/span><b>Development Tools<\/b><span style=\"font-weight: 400;\"> (gcc and other compilers) and <\/span><b>ncurses.<\/b><\/p>\n<p>&nbsp;<\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">yum groupinstall &#8220;Development Tools&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">yum install ncurses ncurses-devel<\/span><\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">With the dependencies installed, we can grab the source code and extract it:<\/span><\/p>\n<p>&nbsp;<\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">wget http:\/\/hisham.hm\/htop\/releases\/2.0.2\/htop-2.0.2.tar.gz<\/span><\/p>\n<p><span style=\"font-weight: 400;\">tar xvfvz htop-2.0.2.tar.gz<\/span><\/p>\n<p><span style=\"font-weight: 400;\">cd htop-2.0.2<\/span><\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Now that we\u2019re in the folder with the htop source code, we can run these three commands to prepare and build the code:<\/span><\/p>\n<p>&nbsp;<\/p>\n<blockquote>\n<p><span style=\"font-weight: 400;\">.\/configure<\/span><\/p>\n<p><span style=\"font-weight: 400;\">make<\/span><\/p>\n<p><span style=\"font-weight: 400;\">make install<\/span><\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Once the make install step completes, you should be able to use htop. Try typing <\/span><span style=\"font-weight: 400;\">htop<\/span><span style=\"font-weight: 400;\"> into your terminal and you should see the system monitor appear.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">If you get a <\/span><span style=\"font-weight: 400;\">htop: command not found<\/span><span style=\"font-weight: 400;\"> error, you\u2019ll need to specify the location of the htop executable in your PATH.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Conclusion: htop on CentOS7 Installed<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">There\u2019s so much you can do with htop, and we hope it will help monitor your processes more quickly and easily. As always, if you have questions please leave them in the comments below.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u2019re really looking for, or you want something that updates more frequently as the state of your system changes. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-183","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":6,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":191,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions\/191"}],"wp:attachment":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}