brew cleanup: Warning: Skipping XXX: most recent version X not installed

Solution 1:

  1. Why my httping package is unlinked? No one knows, it's your machine. We don't know what you have done in the command line.

    To fix the unlinked kegs error, run the following command to relink it manually,

    brew unlink httping
    brew link httping
    
    # if it doesn't link, force link it
    brew link --overwrite httping
    
  2. Why a Homebrew package need to be linked?

    Take httping for an example. httping is installed into /usr/local/Cellar/httping/2.5_2 with the suffix <package-name>/<version>.

    tree -L 2 /usr/local/Cellar/httping/2.5_2
    /usr/local/Cellar/httping/2.5_2
    ├── bin
    │   └── httping
    ├── share
    │   ├── doc
    │   ├── locale
    │   └── man
    ├── INSTALL_RECEIPT.json
    ├── license.txt
    └── readme.txt
    

    Homebrew contains the content of a package in one place, a folder named with pattern above.

    But to expose them for global use, the pkg content needs to be linked under /usr/local, which is an acknowledge place for *nix software installation. So, bin/httping is linked as /usr/local/bin/httping. And other contents also need to be linked into corresponding folder, like /usr/local/share, /usr/local/sbin, etc.


Update

According to the additional info you provided. The installation location of httping should be /usr/local/Cellar/httping/2.5_1, but not /usr/local/Cellar/httping/2.5_1.reinstall. It indicates the reinstall process may be interrupted.

I reproduced the problem on my machine and fixed it by the following commands.

# don't use reinstall
brew uninstall -f httping

# remove possible broken symlinks
brew cleanup

# install httping again
brew install httping

# check the version
brew info httping