Online Install
# CentOS
sudo yum install -y epel-release
sudo yum install -y htop
# Debian
sudo apt install -y htop
Static build
# Install the necessary build dependencies
# Debian
sudo apt-get update
sudo apt-get install build-essential automake autoconf libncurses5-dev libncursesw5-dev
# download source code from github repository
git clone https://github.com/htop-dev/htop.git
cd htop
git checkout -b 3.2.2 3.2.2
# configure the build with the --enable-static option
./autogen.sh
./configure --enable-static
# build htop
make
# verify the static binary
ls -alh htop
ldd htop
FAQ - configure: error: can not find required library libncursesw; you may want to use --disable-unicode
- not useful with
--disable-unicode
option
- solution: build in docker container
docker pull python:bullseye
docker run -v /tmp/:/tmp/ --rm -it python:bullseye bash
# cd /tmp
...
Ref