Build and Install htop 3 on Ubuntu.
This post is part of our ongoing series on our Linux monitoring system. As mentioned earlier, htop
has become increasingly popular among Linux users, due to its modern features and ease of use. Its version 3.2.0 came out a couple of days ago but lots of distributions are still on 2.x and probably will take time before it hits on your distro.
🎧
htop
has numerous user-friendly features as such:
htop
is significantly faster thantop
.- It displays a process tree and comes with mouse support.
- It has a nicer text-graphics interface, with colored output.
- It is highly customizable.
- It also displays a process tree and comes with mouse support.
- Users can perform certain functions related to processes (killing, renicing, etc) which can be done without entering their PIDs.
Let's check what our distribution has to offer.
$ sudo apt info htop
OUTPUT
Package: htop
Version: 2.2.0-2build1
Priority: optional
Section: utils
Origin: Ubuntu
###
##
#
As you can see, they are still way behind; on version 2.2.0.
Install dependency
We’ll need the following dependencies in other to build htop
.
$ sudo apt install gcc make wget tar libncursesw5 libcunit1-ncurses libncursesw5-dev python automake
Download htop
Download the latest version of htop
from its official github.
$ wget https://github.com/htop-dev/htop/archive/3.2.0.tar.gz
Extract the source code.
$ tar zxvf 3.0.1.tar.gz
OUTPUT
of these script created folder
htop-3.2.0
Building htop
1. Generate Configure Script
$ cd htop-3.2.0
bash autogen.sh
2. Configure
$ ./configure
3. Install htop
$ sudo make install
##Check version
$ htop --version
htop 3.2.0
htop
will be installed on /usr/local/bin/htop
to avoid any conflict with htop
installed by Debian's Advanced Package Tool (or APT), which is located on /usr/bin/htop
.
Run htop
Type htop
and press Enter. A screen will open up and will look like the screenshot below.
The htop
footer contains its menu command. These commands can be used to do various functions for instance F2 to Setup Columns or F6 to Sort By can be used to sort the process via CPU usage and memory usage.
You can even display processes for the specific user with htop -u username
Pressing q will simply exit the command mode.
That’s it! _ we hope this article was helpful.
If you need more help you can always refer to the utility' manual or help command as such: man htop
and htop -h
.