97

How do I install htop for macOS (OS X)? (The easiest and laziest path)

3
  • Install Linux in a vm. It's a Linux program which uses Linux-specific kernel features, such as the proc filesystem.
    – jordanm
    Commented Oct 30, 2013 at 22:04
  • No, it has to run natively, it should since htop does works in unix.
    – Ruvenss
    Commented Oct 30, 2013 at 22:16
  • It won't run natively. It's not portable to other *nix OSes for the same reason procps is not portable.
    – jordanm
    Commented Oct 30, 2013 at 22:38

4 Answers 4

136

Here is the laziest way (or homebrew way)

First install Homebrew if you haven't

Second brew install htop

Third, done

3
  • 3
    This no longer seems to work: Error: No available formula or cask with the name "htop".
    – muad-dweeb
    Commented Mar 26, 2021 at 20:32
  • 1
    @muad-dweeb formulae.brew.sh/formula/htop it should still work. Which macOS version you're on? and have you done brew update first?
    – number5
    Commented Apr 6, 2021 at 1:44
  • 5
    Turns out my brew was in a bad state. git -C $(brew --repository homebrew/core) checkout master solved my issue. I am now able to install htop. Cheers!
    – muad-dweeb
    Commented Apr 7, 2021 at 3:16
11

I installed htop 0.8 (update: now 2.0.1) from MacPorts with

sudo port install htop
0
7

Pre-built binary

Found this tutorial that shows how to do it. The steps are as follows:

$ curl -O http://themainframe.ca/wp-content/uploads/2011/06/htop.zip
$ unzip htop.zip
$ sudo mv htop /bin
$ rm htop.zip

This binary is already pre-built so you should use caution when using executables such as this to make sure that they aren't malicious.

Building it from scratch

You can also follow these directions if you'd like to attempt to build the executable yourself. The tutorial is called: htop for Snow Leopard. A copy of the original reference material is here on Tech Chutney.

General steps

$ git clone git://github.com/AndyA/htop-osx.git

Building this under Snow Leopard requires you to checkout the 'osx' branch:

$ cd htop-osx
$ git checkout -b osx origin/osx

and set your 'CFLAGS' environmental variable to specify a 32-bit build:

$ export CFLAGS="-m32"
before the actual build:

$ ./autogen.sh
$ ./configure
$ make
$ make install
7
  • The “building from scratch” option is missing the step where one must actually go into the “htop-osx” before doing anything else. Commented Mar 29, 2014 at 3:00
  • @JakeGould - sorry I thought that was obvious from having to run the script, ./autogen.sh since it's inside that directory. I'll add it.
    – slm
    Commented Mar 29, 2014 at 3:05
  • 1
    @JakeGould - Thanks I see what you mean now. In the future you can edit mistakes such as this, BTW.
    – slm
    Commented Mar 29, 2014 at 14:07
  • 1
    @JakeGould - the link is now broken I referenced but the directions were copied from a blog post so that would explain why they were incorrect. I don't own a Mac system so am unable to confirm these A's when I provide them.
    – slm
    Commented Mar 29, 2014 at 14:15
  • 2
    Unfortunately this is an older version of htop (0.8.2.1) whereas the latest version is 1.0.2 and some functionality (filtering) is missing. It's easy to build from the canonical tarball if you have a recent enough (>= 2.65) version of autoconf. Commented Apr 9, 2014 at 17:19
1

For the latest version ofhtop: https://htop.dev/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .