How To Install bc on CentOS 8
Introduction
In this tutorial we learn how to install bc
on CentOS 8.
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 CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install bc.
Install bc on CentOS 8 Using dnf
Update yum database with dnf
using the following command.
sudo dnf makecache --refresh
The output should look something like this:
CentOS Linux 8 - AppStream 43 kB/s | 4.3 kB 00:00
CentOS Linux 8 - BaseOS 65 kB/s | 3.9 kB 00:00
CentOS Linux 8 - ContinuousRelease 43 kB/s | 3.0 kB 00:00
CentOS Linux 8 - Extras 23 kB/s | 1.5 kB 00:00
CentOS Linux 8 - FastTrack 40 kB/s | 3.0 kB 00:00
CentOS Linux 8 - HighAvailability 36 kB/s | 3.9 kB 00:00
CentOS Linux 8 - Plus 24 kB/s | 1.5 kB 00:00
CentOS Linux 8 - PowerTools 50 kB/s | 4.3 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 13 kB/s | 9.2 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 24 kB/s | 8.5 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 CentOS 8 Using yum
Update yum database with yum
using the following command.
sudo yum makecache --refresh
The output should look something like this:
CentOS Linux 8 - AppStream 43 kB/s | 4.3 kB 00:00
CentOS Linux 8 - BaseOS 65 kB/s | 3.9 kB 00:00
CentOS Linux 8 - ContinuousRelease 43 kB/s | 3.0 kB 00:00
CentOS Linux 8 - Extras 23 kB/s | 1.5 kB 00:00
CentOS Linux 8 - FastTrack 40 kB/s | 3.0 kB 00:00
CentOS Linux 8 - HighAvailability 36 kB/s | 3.9 kB 00:00
CentOS Linux 8 - Plus 24 kB/s | 1.5 kB 00:00
CentOS Linux 8 - PowerTools 50 kB/s | 4.3 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 13 kB/s | 9.2 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 24 kB/s | 8.5 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 CentOS 8
To uninstall only the bc
package we can use the following command:
sudo dnf remove bc
bc Package Contents on CentOS 8
/usr/bin/bc
/usr/bin/dc
/usr/lib/.build-id
/usr/lib/.build-id/7a
/usr/lib/.build-id/7a/12c1f252fda37bf5363a501006ecb64ec0f59a
/usr/lib/.build-id/86
/usr/lib/.build-id/86/c89d0414e276a4e0a5f9a1d4fafcb26f128fea
/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 CentOS 8 using yum and dnf.