{"id":6604,"date":"2024-01-02T10:31:54","date_gmt":"2024-01-02T17:31:54","guid":{"rendered":"https:\/\/ioflood.com\/blog\/?p=6604"},"modified":"2024-01-02T10:32:43","modified_gmt":"2024-01-02T17:32:43","slug":"install-glances-command-linux","status":"publish","type":"post","link":"https:\/\/ioflood.com\/blog\/install-glances-command-linux\/","title":{"rendered":"Linux System Monitoring: How-to Install &#8216;Glances&#8217; in Linux"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/ioflood.com\/blog\/wp-content\/uploads\/2024\/01\/Digital-illustration-of-a-Linux-terminal-depicting-the-installation-of-the-glances-command-a-cross-platform-system-monitoring-tool-300x300.jpg\" alt=\"Digital illustration of a Linux terminal depicting the installation of the glances command a cross-platform system monitoring tool\" width=\"300\" height=\"300\" title=\"\"><\/figure>\n<\/div>\n<p>Are you looking to install the <code>glances<\/code> command on your Linux system but aren&#8217;t sure where to start? Many Linux users, particularly beginners, might find the task intimidating. Yet, <code>glances<\/code> is a powerful tool for monitoring system performance; it&#8217;s a utility worth mastering. Glances is also readily available on most package management systems, making it a straightforward tool once you know-how.<\/p>\n<p><strong>In this tutorial, we will guide you on how to install the <code>glances<\/code> command on your Linux system.<\/strong> We will show you methods for both APT and YUM-based distributions, delve into compiling <code>glances<\/code> from source, installing a specific version, and finally, how to use the <code>glances<\/code> command and ensure it&#8217;s installed correctly.<\/p>\n<p>So, let&#8217;s dive in and begin installing <code>glances<\/code> on your Linux system!<\/p>\n<h2>TL;DR: How Do I Install and Use the &#8216;glances&#8217; Command in Linux?<\/h2>\n<blockquote><p>\n  To install <code>'glances'<\/code> in Debian based distributions like Ubuntu, you can run the command <code>sudo apt-get install glances<\/code>. For distributions like CentOS that use the RPM package manager, you would run the command <code>sudo yum install glances<\/code>.\n<\/p><\/blockquote>\n<pre><code class=\"language-bash line-numbers\"># For Debian based distributions like Ubuntu\nsudo apt-get install glances\n\n# For RPM based distributions like CentOS\nsudo yum install glances\n\n# Output:\n# 'glances' is now installed on your system.\n<\/code><\/pre>\n<p>This is just a basic way to install the &#8216;glances&#8217; command in Linux, but there&#8217;s much more to learn about installing and using &#8216;glances&#8217;. Continue reading for more detailed information and advanced usage scenarios.<\/p>\n<h2>Understanding and Installing the &#8216;glances&#8217; Command<\/h2>\n<p>The &#8216;glances&#8217; command is a cross-platform system monitoring tool written in Python. It allows you to monitor your system&#8217;s performance at a glance, hence the name. With &#8216;glances&#8217;, you can monitor CPU, Load Average, Memory, Network Interfaces, Disk I\/O, Processes and File System spaces utilization.<\/p>\n<p>It&#8217;s a versatile tool that provides a comprehensive view of your system&#8217;s performance, making it an essential command for Linux users, particularly system administrators. Now, let&#8217;s dive into how you can install the &#8216;glances&#8217; command on your Linux system.<\/p>\n<h3>Installing &#8216;glances&#8217; with APT<\/h3>\n<p>If you&#8217;re running a Debian-based distribution like Ubuntu, you can install &#8216;glances&#8217; using the APT package manager. Here&#8217;s how:<\/p>\n<pre><code class=\"language-bash line-numbers\">sudo apt update\nsudo apt install glances\n\n# Output:\n# 'glances' is now installed on your system.\n<\/code><\/pre>\n<p>This command first updates your package lists and then installs &#8216;glances&#8217;.<\/p>\n<h3>Installing &#8216;glances&#8217; with YUM<\/h3>\n<p>For distributions like CentOS that use the YUM package manager, you can install &#8216;glances&#8217; with the following command:<\/p>\n<pre><code class=\"language-bash line-numbers\">sudo yum check-update\nsudo yum install glances\n\n# Output:\n# 'glances' is now installed on your system.\n<\/code><\/pre>\n<p>This command first checks for package updates and then installs &#8216;glances&#8217;.<\/p>\n<h2>Installing &#8216;glances&#8217; from Source Code<\/h2>\n<p>For those who prefer to install &#8216;glances&#8217; directly from the source, follow these steps:<\/p>\n<ol>\n<li>Clone the &#8216;glances&#8217; repository from GitHub:<\/li>\n<\/ol>\n<pre><code class=\"language-bash line-numbers\">git clone https:\/\/github.com\/nicolargo\/glances.git\n\n# Output:\n# Cloning into 'glances'...\n<\/code><\/pre>\n<ol start=\"2\">\n<li>Navigate into the cloned repository:<\/li>\n<\/ol>\n<pre><code class=\"language-bash line-numbers\">cd glances\n\n# Output:\n# You are now in the 'glances' directory.\n<\/code><\/pre>\n<ol start=\"3\">\n<li>Install &#8216;glances&#8217; using the setup.py script:<\/li>\n<\/ol>\n<pre><code class=\"language-bash line-numbers\">sudo python setup.py install\n\n# Output:\n# 'glances' is now installed on your system.\n<\/code><\/pre>\n<h2>Installing Specific Versions of &#8216;glances&#8217;<\/h2>\n<h3>From Source<\/h3>\n<p>To install a specific version of &#8216;glances&#8217; from source, you would checkout to the specific version tag before running the setup script. Here&#8217;s how:<\/p>\n<pre><code class=\"language-bash line-numbers\">git checkout v3.1.5\nsudo python setup.py install\n\n# Output:\n# 'glances' version 3.1.5 is now installed on your system.\n<\/code><\/pre>\n<h3>Using Package Managers<\/h3>\n<h4>APT<\/h4>\n<p>For APT, you can specify the version of &#8216;glances&#8217; to install like this:<\/p>\n<pre><code class=\"language-bash line-numbers\">sudo apt-get install glances=3.1.5\n\n# Output:\n# 'glances' version 3.1.5 is now installed on your system.\n<\/code><\/pre>\n<h4>YUM<\/h4>\n<p>For YUM, you would do:<\/p>\n<pre><code class=\"language-bash line-numbers\">sudo yum install glances-3.1.5\n\n# Output:\n# 'glances' version 3.1.5 is now installed on your system.\n<\/code><\/pre>\n<h3>Version Comparison<\/h3>\n<p>Different versions of &#8216;glances&#8217; come with different features, improvements, and bug fixes. For example, version 3.1.5 improved the Docker and Quicklook plugins, while version 3.1.4 fixed a bug with the GPU plugin. Here&#8217;s a quick comparison:<\/p>\n<table>\n<thead>\n<tr>\n<th>Version<\/th>\n<th>Key Changes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>3.1.5<\/td>\n<td>Improved Docker and Quicklook plugins<\/td>\n<\/tr>\n<tr>\n<td>3.1.4<\/td>\n<td>Fixed bug with GPU plugin<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Basic Usage and Verification<\/h2>\n<h3>How to Use &#8216;glances&#8217;<\/h3>\n<p>To start using &#8216;glances&#8217;, simply type <code>glances<\/code> in your terminal:<\/p>\n<pre><code class=\"language-bash line-numbers\">glances\n\n# Output:\n# Displays a comprehensive overview of your system's performance.\n<\/code><\/pre>\n<h3>Verifying the Installation<\/h3>\n<p>You can verify that &#8216;glances&#8217; is correctly installed by checking its version:<\/p>\n<pre><code class=\"language-bash line-numbers\">glances -V\n\n# Output:\n# Glances version 3.1.5\n<\/code><\/pre>\n<p>This command should display the version of &#8216;glances&#8217; that you have installed on your system.<\/p>\n<h2>Exploring Alternative System Monitoring Tools<\/h2>\n<p>While &#8216;glances&#8217; is a powerful tool for system monitoring, there are other commands available in Linux that can provide similar functionality. Two such commands are &#8216;top&#8217; and &#8216;htop&#8217;.<\/p>\n<h3>The &#8216;top&#8217; Command<\/h3>\n<p>The &#8216;top&#8217; command provides a real-time, dynamic view of the processes running in a system. It&#8217;s a handy tool for system administrators looking to monitor the performance of a Linux system. Here&#8217;s how you can use it:<\/p>\n<pre><code class=\"language-bash line-numbers\">top\n\n# Output:\n# Displays a real-time view of your system's performance.\n<\/code><\/pre>\n<p>The &#8216;top&#8217; command provides a lot of information, including the PID (Process ID), USER (the user running the process), CPU usage, and memory usage.<\/p>\n<h3>The &#8216;htop&#8217; Command<\/h3>\n<p>While &#8216;top&#8217; is a great tool, &#8216;htop&#8217; takes it a step further. It provides a full list of processes running, instead of the top resource-consuming processes. It also provides a real-time view of a running system. Here&#8217;s how you can use &#8216;htop&#8217;:<\/p>\n<pre><code class=\"language-bash line-numbers\">htop\n\n# Output:\n# Displays a comprehensive, real-time view of your system's performance.\n<\/code><\/pre>\n<p>To install &#8216;htop&#8217;, you can use the following commands:<\/p>\n<pre><code class=\"language-bash line-numbers\"># For Debian based distributions like Ubuntu\nsudo apt-get install htop\n\n# For RPM based distributions like CentOS\nsudo yum install htop\n\n# Output:\n# 'htop' is now installed on your system.\n<\/code><\/pre>\n<h3>Comparing &#8216;glances&#8217;, &#8216;top&#8217;, and &#8216;htop&#8217;<\/h3>\n<p>While all three commands provide system monitoring functionality, they each have their strengths and weaknesses. For example, &#8216;glances&#8217; provides a more comprehensive overview of system performance, while &#8216;top&#8217; and &#8216;htop&#8217; offer real-time performance tracking. Here&#8217;s a comparison:<\/p>\n<table>\n<thead>\n<tr>\n<th>Command<\/th>\n<th>Strengths<\/th>\n<th>Weaknesses<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>glances<\/td>\n<td>Comprehensive overview, cross-platform<\/td>\n<td>Not installed by default<\/td>\n<\/tr>\n<tr>\n<td>top<\/td>\n<td>Real-time tracking, installed by default<\/td>\n<td>Less comprehensive<\/td>\n<\/tr>\n<tr>\n<td>htop<\/td>\n<td>Full list of processes, real-time tracking<\/td>\n<td>Not installed by default<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In conclusion, while &#8216;glances&#8217; is an excellent tool for monitoring system performance in Linux, &#8216;top&#8217; and &#8216;htop&#8217; are viable alternatives that offer slightly different functionality. Depending on your specific needs, you might find one more useful than the others.<\/p>\n<h2>Troubleshooting Common &#8216;glances&#8217; Issues<\/h2>\n<p>While &#8216;glances&#8217; is a robust and reliable tool, you may encounter some issues when using it. Below are some common problems and their solutions.<\/p>\n<h3>&#8216;glances&#8217; Command Not Found<\/h3>\n<p>If you find that &#8216;glances&#8217; is not recognized as a command, it may not be installed correctly or the system may not have updated its list of available commands. You can update the list of available commands with the following:<\/p>\n<pre><code class=\"language-bash line-numbers\">hash -r\n\n# Output:\n# The shell's memory is now refreshed.\n<\/code><\/pre>\n<p>After running this command, try running &#8216;glances&#8217; again.<\/p>\n<h3>&#8216;glances&#8217; Not Displaying Correctly<\/h3>\n<p>If &#8216;glances&#8217; is not displaying correctly, it could be due to the size of your terminal window. &#8216;glances&#8217; requires a certain amount of space to display all its information. Try increasing the size of your terminal window and running &#8216;glances&#8217; again.<\/p>\n<h3>&#8216;glances&#8217; Not Showing All Information<\/h3>\n<p>&#8216;glances&#8217; has many optional features that can be enabled or disabled. If you&#8217;re not seeing the information you expect, you may need to enable a specific feature. For example, to enable the disk I\/O stats, you can use the &#8216;-d&#8217; option:<\/p>\n<pre><code class=\"language-bash line-numbers\">glances -d\n\n# Output:\n# 'glances' now shows disk I\/O stats.\n<\/code><\/pre>\n<h3>&#8216;glances&#8217; Running Slowly<\/h3>\n<p>If &#8216;glances&#8217; is running slowly, it could be due to the number of processes it&#8217;s monitoring. You can limit the number of processes &#8216;glances&#8217; monitors with the &#8216;-p&#8217; option:<\/p>\n<pre><code class=\"language-bash line-numbers\">glances -p 50\n\n# Output:\n# 'glances' now only monitors the top 50 processes.\n<\/code><\/pre>\n<p>In conclusion, while &#8216;glances&#8217; is generally a reliable tool, you may encounter some issues when using it. However, with a bit of troubleshooting and understanding of its options, you can overcome these challenges and make the most of this powerful tool.<\/p>\n<h2>System Monitoring in Linux: Why It Matters<\/h2>\n<p>System monitoring is a crucial aspect of Linux system administration. It involves observing and checking the status of system components, such as the CPU, memory, disk usage, and network traffic. This is where the &#8216;glances&#8217; command comes in handy.<\/p>\n<h3>The Role of System Monitoring<\/h3>\n<p>System monitoring helps administrators identify any potential issues or bottlenecks that might be affecting the system&#8217;s performance. By regularly monitoring the system, you can spot trends and patterns that could indicate a larger issue. For example, if you notice that your CPU usage is consistently high, it could be a sign that a process or application is using more resources than it should.<\/p>\n<pre><code class=\"language-bash line-numbers\"># Example of monitoring CPU usage with 'glances'\nglances -1\n\n# Output:\n# Displays the CPU usage in a simplified view.\n<\/code><\/pre>\n<p>This command displays a simplified view of CPU usage, making it easier to identify any processes that are consuming too much CPU.<\/p>\n<h3>Understanding the &#8216;glances&#8217; Command<\/h3>\n<p>The &#8216;glances&#8217; command offers a comprehensive system monitoring solution for Linux. It provides a real-time overview of your system&#8217;s performance, including CPU usage, memory usage, disk I\/O, network traffic, and more.<\/p>\n<pre><code class=\"language-bash line-numbers\"># Example of using 'glances' to monitor system performance\nglances\n\n# Output:\n# Displays a comprehensive overview of your system's performance.\n<\/code><\/pre>\n<p>This command provides a real-time snapshot of your system&#8217;s performance, allowing you to monitor all the key metrics in one place.<\/p>\n<p>In conclusion, system monitoring is a vital part of maintaining a healthy Linux system. Tools like &#8216;glances&#8217; make it easy to keep an eye on your system&#8217;s performance and identify any potential issues before they become major problems.<\/p>\n<h2>The Relevance of System Monitoring in System Administration and Security<\/h2>\n<p>System monitoring plays a significant role in both system administration and security. By keeping a close eye on your Linux system&#8217;s performance, you can detect anomalies that might indicate a security breach or system malfunction. For instance, an unexpected spike in network traffic could be a sign of a DoS attack, while high CPU usage could indicate a runaway process.<\/p>\n<pre><code class=\"language-bash line-numbers\"># Example of using 'glances' to monitor network traffic\n\nglances -n\n\n# Output:\n# Displays network traffic in real-time.\n<\/code><\/pre>\n<p>This command allows you to monitor your network traffic in real-time, making it easier to spot any unexpected spikes that could indicate a problem.<\/p>\n<h3>Exploring Related Concepts: Process Management and Resource Allocation<\/h3>\n<p>Understanding how to manage processes and allocate resources is crucial for effective system administration. Tools like &#8216;glances&#8217; can provide valuable insights into which processes are running, how much CPU they&#8217;re using, and how much memory they&#8217;re consuming.<\/p>\n<pre><code class=\"language-bash line-numbers\"># Example of using 'glances' to monitor process usage\n\nglances -p\n\n# Output:\n# Displays the current processes and their resource usage.\n<\/code><\/pre>\n<p>This command gives you a snapshot of the current processes and their resource usage, helping you manage your system&#8217;s resources more effectively.<\/p>\n<h3>Further Resources for System Monitoring Mastery<\/h3>\n<ol>\n<li><a class=\"wp-editor-md-post-content-link\" href=\"http:\/\/www.tldp.org\/LDP\/sag\/html\/index.html\" target=\"_blank\" rel=\"noopener\">The Linux System Administrator&#8217;s Guide<\/a> &#8211; An invaluable resource for any Linux system administrator. This guide covers a wide range of topics, including system monitoring, process management, and resource allocation.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/nicolargo\/glances\" target=\"_blank\" rel=\"noopener\">The &#8216;glances&#8217; GitHub Page<\/a> &#8211; The official &#8216;glances&#8217; GitHub page. Here you can find the latest updates, documentation, and user guide for &#8216;glances&#8217;.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"http:\/\/www.brendangregg.com\/linuxperf.html\" target=\"_blank\" rel=\"noopener\">Linux Performance<\/a> &#8211; A comprehensive resource on Linux performance tools. This site provides in-depth information on various system monitoring tools, including &#8216;glances&#8217;.<\/p>\n<\/li>\n<\/ol>\n<h2>Wrapping Up: Mastering &#8216;glances&#8217; for Linux System Monitoring<\/h2>\n<p>In this comprehensive guide, we&#8217;ve journeyed through the process of installing and using the &#8216;glances&#8217; command in Linux, a powerful tool for monitoring system performance.<\/p>\n<p>We began with the basics, learning how to install &#8216;glances&#8217; using the APT and YUM package managers. We then ventured into more advanced territory, exploring how to install &#8216;glances&#8217; from source and how to install specific versions of &#8216;glances&#8217;. Along the way, we tackled common issues you might face when using &#8216;glances&#8217;, providing you with solutions and workarounds for each issue.<\/p>\n<p>We also looked at alternative approaches to system monitoring in Linux, comparing &#8216;glances&#8217; with other commands like &#8216;top&#8217; and &#8216;htop&#8217;. Here&#8217;s a quick comparison of these commands:<\/p>\n<table>\n<thead>\n<tr>\n<th>Command<\/th>\n<th>Pros<\/th>\n<th>Cons<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>glances<\/td>\n<td>Comprehensive overview, cross-platform<\/td>\n<td>Not installed by default<\/td>\n<\/tr>\n<tr>\n<td>top<\/td>\n<td>Real-time tracking, installed by default<\/td>\n<td>Less comprehensive<\/td>\n<\/tr>\n<tr>\n<td>htop<\/td>\n<td>Full list of processes, real-time tracking<\/td>\n<td>Not installed by default<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Whether you&#8217;re a beginner just starting out with Linux system monitoring or an experienced system administrator looking to level up your skills, we hope this guide has given you a deeper understanding of the &#8216;glances&#8217; command and its capabilities.<\/p>\n<p>With its balance of comprehensive monitoring capabilities and ease of use, &#8216;glances&#8217; is a powerful tool for any Linux user. Happy monitoring!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you looking to install the glances command on your Linux system but aren&#8217;t sure where to start? Many Linux users, particularly beginners, might find the task intimidating. Yet, glances is a powerful tool for monitoring system performance; it&#8217;s a utility worth mastering. Glances is also readily available on most package management systems, making it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":14877,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[124,3,9],"tags":[],"class_list":["post-6604","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash","category-linux","category-sysadmin","cat-124-id","cat-3-id","cat-9-id","has_thumb"],"_links":{"self":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/6604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/comments?post=6604"}],"version-history":[{"count":5,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/6604\/revisions"}],"predecessor-version":[{"id":14844,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/6604\/revisions\/14844"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media\/14877"}],"wp:attachment":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media?parent=6604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/categories?post=6604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/tags?post=6604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}