How To Install bc on Fedora 34

bc is GNU’s bc (a numeric processing language) and dc (a calculator)

Introduction

In this tutorial we learn how to install bc on Fedora 34.

What is bc

The bc package includes bc and dc. Bc is an arbitrary precision numeric processing arithmetic language. Dc is an interactive arbitrary precision stack based calculator, which can be used as a text mode calculator. Install the bc package if you need its number handling capabilities or if you would like to use its text mode calculator.

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

Install bc on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

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

sudo dnf -y install bc

Install bc on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

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

sudo yum -y install bc

How To Uninstall bc on Fedora 34

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

sudo dnf remove bc

bc Package Contents on Fedora 34

/usr/bin/bc
/usr/bin/dc
/usr/lib/.build-id
/usr/lib/.build-id/92
/usr/lib/.build-id/92/61662558febf32d107307629077355740cde08
/usr/lib/.build-id/c1
/usr/lib/.build-id/c1/90d6c5f70d2275fa87841ea9781b61d7cf11a1
/usr/share/doc/bc
/usr/share/doc/bc/AUTHORS
/usr/share/doc/bc/Examples
/usr/share/doc/bc/Examples/ckbook.b
/usr/share/doc/bc/Examples/pi.b
/usr/share/doc/bc/Examples/primes.b
/usr/share/doc/bc/Examples/twins.b
/usr/share/doc/bc/FAQ
/usr/share/doc/bc/NEWS
/usr/share/doc/bc/README
/usr/share/info/bc.info.gz
/usr/share/info/dc.info.gz
/usr/share/licenses/bc
/usr/share/licenses/bc/COPYING
/usr/share/licenses/bc/COPYING.LIB
/usr/share/man/man1/bc.1.gz
/usr/share/man/man1/dc.1.gz

References

Summary

In this tutorial we learn how to install bc on Fedora 34 using yum and dnf.