Skip to content

Building htop

aborkar-ibm edited this page Sep 1, 2020 · 36 revisions

Building htop

Below versions of htop are available in respective distributions at the time of the creation of these build instructions:

  • SLES 12 SP5 has 2.0.2-9.1
  • Ubuntu 18.04 has 2.1.0
  • Ubuntu 20.04 has 2.2.0

The instructions provided below specify the steps to build htop v2.2.0 on Linux on IBM Z for following distributions:

  • RHEL (7.6, 7.7, 7.8, 8.1, 8.2)
  • SLES (12 SP5, 15 SP1, 15 SP2)
  • Ubuntu (18.04)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Step 1: Build using script

If you want to build htop using manual steps, go to STEP 2.

Use the following commands to build htop using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Htop/2.2.0/build_htop.sh

# Build htop
bash build_htop.sh

If the build completes successfully, go to STEP 7. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.

2. Install the dependencies

  • RHEL (7.6, 7.7, 7.8)

     sudo yum install ncurses ncurses-devel gcc make wget tar python automake
  • RHEL (8.1, 8.2)

     sudo yum install ncurses ncurses-devel gcc make wget tar python2 automake
     sudo ln -s /usr/bin/python2 /usr/bin/python
  • SLES (12 SP5, 15 SP1, 15 SP2)

     sudo zypper install ncurses ncurses-devel gcc make wget tar python awk automake
  • Ubuntu (18.04)

     sudo apt-get install gcc make wget tar libncursesw5 libcunit1-ncurses libncursesw5-dev python automake

3. Download and unpack the htop 2.2.0 source code

    cd /<source_root>/
    wget https://github.com/hishamhm/htop/archive/2.2.0.tar.gz
    tar xvzf 2.2.0.tar.gz

4. Configure and build htop-2.2.0

    cd /<source_root>/htop-2.2.0
    bash autogen.sh
    ./configure
    make

5. Run test cases if any(optional)

    make check

6. Install htop

    sudo  make install

7. Launch htop to monitor system

    htop 

Note: For a list of supported key commands see the manual page man htop on ubuntu.

References:

Clone this wiki locally