How To Install Glances on Ubuntu 24.04 LTS What is Glances? Glances is an open-source, cross-platform system monitoring tool that provides a wealth of information about your system’s performance in real-time. Developed as a Python application, Glances offers a top-like interface with additional features that make it stand out from traditional monitoring tools. Key features of Glances include: Real-time monitoring of CPU, memory, disk, and network usage Process monitoring with detailed information Support for various output formats (console, web interface, CSV) Customizable alerts and thresholds Extensibility through plugins Remote monitoring capabilities Compared to other monitoring tools like top or htop, Glances provides a more comprehensive view of system resources and offers greater flexibility in terms of configuration and output options. Its ability to run in client/server mode makes it particularly useful for monitoring remote systems, a feature that sets it apart from many alternatives. Prerequisites Before proceeding with the installation of Glances on Ubuntu 24.04 LTS, ensure that your system meets the following requirements: A system running Ubuntu 24.04 LTS (Lunar Lobster) Sufficient disk space (at least 100 MB free) An active internet connection for downloading packages Sudo or root access to the system It’s also recommended to update your system before installation to ensure you have the latest packages and security updates. You can do this by running: sudo apt update && sudo apt upgrade -y Installation Methods There are several methods available for installing Glances on Ubuntu 24.04 LTS. Each method has its advantages and potential use cases. We’ll cover three primary installation methods: Installing via APT (Advanced Package Tool) Installing via PIP (Python Package Installer) Installing from source Choose the method that best suits your needs and system configuration. The APT method is generally the simplest and most straightforward for most users, while the PIP method offers more control over the Python environment. Installing from source provides the latest features but requires more manual steps. Method 1: Installing Glances via APT The APT method is the easiest way to install Glances on Ubuntu 24.04 LTS. It ensures that you get a version of Glances that is compatible with your system and automatically handles dependencies. Step 1: Update Package Lists First, update your package lists to ensure you have the latest information: sudo apt update Step 2: Install Glances Now, install Glances using the following command: sudo apt install glances This command will download and install Glances along with any necessary dependencies. Step 3: Verify the Installation After the installation is complete, you can verify it by checking the version of Glances: glances --version This should display the version number of Glances installed on your system. Method 2: Installing Glances via PIP Installing Glances via PIP allows you to manage it as a Python package, which can be useful if you’re working in Python environments or want more control over the installation. Step 1: Install Python and PIP Ubuntu 24.04 LTS comes with Python pre-installed, but you may need to install pip. You can do this with the following command: sudo apt install python3-pip Step 2: Install Glances using PIP Once pip is installed, you can use it to install Glances: pip3 install glances If you want to install Glances system-wide, use: sudo pip3 install glances Step 3: Upgrading Glances with PIP To upgrade Glances to the latest version using pip, you can use the following command: pip3 install --upgrade glances Remember to use sudo if you installed Glances system-wide. Method 3: Installing Glances from Source Installing Glances from source gives you access to the latest features and allows for customization during the build process. However, it requires more manual steps and may not be suitable for all users. Step 1: Download the Source Code First, clone the Glances repository from GitHub: git clone https://github.com/nicolargo/glances.git Step 2: Install Dependencies Navigate to the cloned directory and install the required dependencies: cd glances sudo apt install python3-dev pip3 install -r requirements.txt Step 3: Install Glances Now, you can install Glances using the setup script: sudo python3 setup.py install Pros and Cons of Source Installation Pros: Access to the latest features and bug fixes Ability to customize the installation Useful for development and testing Cons: More complex installation process May require manual management of dependencies Updates need to be performed manually Configuring Glances After installing Glances, you may want to configure it to suit your specific needs. The configuration file for Glances is typically located at /etc/glances/glances.conf for system-wide installations or ~/.config/glances/glances.conf for user-specific configurations. Basic Configuration Options Some basic configuration options you might want to adjust include: Refresh rate: Set how often Glances updates its display Displayed modules: Choose which system metrics to show Alert thresholds: Set custom thresholds for warnings and critical alerts You can edit the configuration file using a text editor: sudo nano /etc/glances/glances.conf Advanced Configuration Tips For more advanced users, Glances offers several advanced configuration options: Setting up export modules for data logging Configuring network interfaces for monitoring Customizing the web interface Setting up remote monitoring Remember to restart Glances after making changes to the configuration file for the changes to take effect. Using Glances Starting Glances To start Glances, simply open a terminal and type: glances