How To Install ShellCheck on CentOS 7

In this tutorial we learn how to install ShellCheck on CentOS 7. ShellCheck is Tool for checking common errors in POSIX shell scripts

Introduction

In this tutorial we learn how to install ShellCheck on CentOS 7.

What is ShellCheck

The goals of ShellCheck are * To point out and clarify typical beginner’s syntax issues, that causes a shell to give cryptic error messages. * To point out and clarify typical intermediate level semantic problems, that causes a shell to behave strangely and counter-intuitively. * To point out subtle caveats, corner cases and pitfalls, that may cause an advanced user’s otherwise working script to fail under future circumstances.

We can use yum or dnf to install ShellCheck on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install ShellCheck.

Install ShellCheck on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install ShellCheck using yum by running the following command:

sudo yum -y install ShellCheck

Install ShellCheck on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install ShellCheck using dnf by running the following command:

sudo dnf -y install ShellCheck

How To Uninstall ShellCheck on CentOS 7

To uninstall only the ShellCheck package we can use the following command:

sudo dnf remove ShellCheck

References

Summary

In this tutorial we learn how to install ShellCheck on CentOS 7 using yum and dnf.