Short Tip: Install shellcheck on an outdated CentOS

I’ve to install shellcheck on a CentOS 7 box, this is the latest CentOS version. The tool is a great linter for bash scripts, which I want to integrate into our CI pipeline. shellcheck isn’t packaged so I will build it from source. From their installguide:

yum -y install cabal-install
su jenkins
cd ~
cabal update
cabal install shellcheck

This will fail because the cabal lib is outdated. Remember that this is the latest CentOS….
Lucky me, I can build a new cabal version with cabal:

cabal install cabal

After that step we can successfully build shellcheck:

cabal install shellcheck

The shellcheck binary is now available in ~/.cabal/bin/shellcheck

This entry was posted in General, Linux, Short Tips. Bookmark the permalink.

2 Responses to Short Tip: Install shellcheck on an outdated CentOS

  1. This isn’t working for me on a fresh CentOS 7 installation. The shellcheck binary doesn’t exist. Also tried with dnf, but it seems the package only exists for Fedora..

  2. Feiko Nanninga says:

    Can the same be done on CentOS 8? cabal-install does not seem to be available.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.