How To Install bats on Fedora 36

In this tutorial we learn how to install bats in Fedora 36. bats is Bash Automated Testing System

Introduction

In this tutorial we learn how to install bats on Fedora 36.

What is bats

Bats is a TAP-compliant testing framework for Bash. It provides a simple way to verify that the UNIX programs you write behave as expected. Bats is most useful when testing software written in Bash, but you can use it to test any UNIX program.

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

Install bats on Fedora 36 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install bats

Install bats on Fedora 36 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install bats

How To Uninstall bats on Fedora 36

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

sudo dnf remove bats

bats Package Contents on Fedora 36

/usr/bin/bats
/usr/lib/bats-core
/usr/lib/bats-core/common.bash
/usr/lib/bats-core/formatter.bash
/usr/lib/bats-core/preprocessing.bash
/usr/lib/bats-core/semaphore.bash
/usr/lib/bats-core/test_functions.bash
/usr/lib/bats-core/tracing.bash
/usr/lib/bats-core/validator.bash
/usr/libexec/bats-core
/usr/libexec/bats-core/bats
/usr/libexec/bats-core/bats-exec-file
/usr/libexec/bats-core/bats-exec-suite
/usr/libexec/bats-core/bats-exec-test
/usr/libexec/bats-core/bats-format-cat
/usr/libexec/bats-core/bats-format-junit
/usr/libexec/bats-core/bats-format-pretty
/usr/libexec/bats-core/bats-format-tap
/usr/libexec/bats-core/bats-format-tap13
/usr/libexec/bats-core/bats-preprocess
/usr/share/doc/bats
/usr/share/doc/bats/AUTHORS
/usr/share/doc/bats/CHANGELOG.md
/usr/share/doc/bats/README.md
/usr/share/licenses/bats
/usr/share/licenses/bats/LICENSE.md
/usr/share/man/man1/bats.1.gz
/usr/share/man/man7/bats.7.gz

References

Summary

In this tutorial we learn how to install bats on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).