This article is going to teach you how to install htop
command on Ubuntu 22.04. htop
is a process-viewer and manager for interactive system monitoring and management. It was created as an alternative for the Unix software top. It displays a frequently updated list of the processes currently executing on a computer, usually in order of CPU consumption.
Unlike top, htop displays the entire list of processes operating instead of just the most resource-intensive ones. htop
displays information on the processor, swap, and memory status in color. The processes can alternatively be viewed as a tree with htop.
We are going to install htop using two methods;
How to Install htop command on Ubuntu 22.04
- Lets start by updating all packages using the command below.
sudo apt update
Install htop command on Ubuntu 22.04 using APT
- Run the command below to install htop
sudo apt install htop
Output
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: gconf-service gconf-service-backend gconf2-common libappindicator1 libc++1 libc++1-10 libc++abi1-10 libdbusmenu-gtk4 libegl1-mesa libgconf-2-4 libxcb-xtest0 linux-headers-5.13.0-25-generic linux-hwe-5.13-headers-5.13.0-25 linux-image-5.13.0-25-generic linux-modules-5.13.0-25-generic linux-modules-extra-5.13.0-25-generic Use 'sudo apt autoremove' to remove them. The following NEW packages will be installed: htop 0 upgraded, 1 newly installed, 0 to remove and 19 not upgraded. Need to get 80.5 kB of archives. After this operation, 225 kB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 htop amd64 2.2.0-2build1 [80.5 kB] Fetched 80.5 kB in 1s (60.7 kB/s) Selecting previously unselected package htop. (Reading database ... 283612 files and directories currently installed.) Preparing to unpack .../htop_2.2.0-2build1_amd64.deb ... Unpacking htop (2.2.0-2build1) ... Setting up htop (2.2.0-2build1) ... Processing triggers for desktop-file-utils (0.24-1ubuntu3) ... Processing triggers for mime-support (3.64ubuntu1) ... Processing triggers for gnome-menus (3.36.0-1ubuntu1) ... Processing triggers for man-db (2.9.1-1) ...
htop
should have been installed after running the command above.
Remove htop on Ubuntu 22.04 using APT
- To uninstall htop package on Ubuntu 22.04 run the command below.
sudo apt remove htop
Output
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: gconf-service gconf-service-backend gconf2-common libappindicator1 libc++1 libc++1-10 libc++abi1-10 libdbusmenu-gtk4 libegl1-mesa libgconf-2-4 libxcb-xtest0 linux-headers-5.13.0-25-generic linux-hwe-5.13-headers-5.13.0-25 linux-image-5.13.0-25-generic linux-modules-5.13.0-25-generic linux-modules-extra-5.13.0-25-generic Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: htop 0 upgraded, 0 newly installed, 1 to remove and 19 not upgraded. After this operation, 225 kB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 283621 files and directories currently installed.) Removing htop (2.2.0-2build1) ... Processing triggers for mime-support (3.64ubuntu1) ... Processing triggers for gnome-menus (3.36.0-1ubuntu1) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Install htop command on Ubuntu 22.04 using SNAP
- To install htop command on Ubuntu 22.04 using SNAP run the command below.
sudo snap install htop
Uninstall htop on Ubuntu 22.04 using SNAP
- Run the command below to uninstall htop on Ubuntu 22.04 using SNAP
sudo snap remove htop
How to use htop on Ubuntu 22.04
- To start htop on Ubuntu 22.04, run the command below.
htop
- The sample window below will appear.
- To search for any process on htop press F3 key as shown below
- You can also filter processes on htop using F4 key
- To view process as tree press F5
- You can also see how much memory is used up as shown below
- Navigate to htop official website to read more about it’s commands and usage.
- Congratulations you have reached the end of the article. You have learned how to install htop on Ubuntu 22.04
Other Tutorials
Install Nextcloud on Ubuntu 22.04