How To Install libstdc++ on Rocky Linux 8

In this tutorial we learn how to install libstdc++ on Rocky Linux 8. libstdc++ is GNU Standard C++ Library

Introduction

In this tutorial we learn how to install libstdc++ on Rocky Linux 8.

What is libstdc++

The libstdc++ package contains a rewritten standard compliant GCC Standard C++ Library.

We can use yum or dnf to install libstdc++ on Rocky Linux 8. In this tutorial we discuss both methods but you only need to choose one of method to install libstdc++.

Install libstdc++ on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install libstdc++

Install libstdc++ on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install libstdc++

How To Uninstall libstdc++ on Rocky Linux 8

To uninstall only the libstdc++ package we can use the following command:

sudo dnf remove libstdc++

libstdc++ Package Contents on Rocky Linux 8

/usr/lib/.build-id
/usr/lib/.build-id/9d
/usr/lib/.build-id/9d/ca3aa38e774813d7b85280d84f172bdae48ef0
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.25
/usr/share/gcc-8
/usr/share/gcc-8/python
/usr/share/gcc-8/python/libstdcxx
/usr/share/gcc-8/python/libstdcxx/__init__.py
/usr/share/gcc-8/python/libstdcxx/__pycache__
/usr/share/gcc-8/python/libstdcxx/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/share/gcc-8/python/libstdcxx/__pycache__/__init__.cpython-36.pyc
/usr/share/gcc-8/python/libstdcxx/v6
/usr/share/gcc-8/python/libstdcxx/v6/__init__.py
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/__init__.cpython-36.pyc
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/printers.cpython-36.opt-1.pyc
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/printers.cpython-36.pyc
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/xmethods.cpython-36.opt-1.pyc
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/xmethods.cpython-36.pyc
/usr/share/gcc-8/python/libstdcxx/v6/printers.py
/usr/share/gcc-8/python/libstdcxx/v6/xmethods.py
/usr/share/gdb
/usr/share/gdb/auto-load
/usr/share/gdb/auto-load/usr
/usr/share/gdb/auto-load/usr/lib
/usr/share/gdb/auto-load/usr/lib/__pycache__
/usr/share/gdb/auto-load/usr/lib/__pycache__/libstdc++.so.6.0.25-gdb.cpython-36.opt-1.pyc
/usr/share/gdb/auto-load/usr/lib/__pycache__/libstdc++.so.6.0.25-gdb.cpython-36.pyc
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.25-gdb.py
/usr/lib/.build-id
/usr/lib/.build-id/da
/usr/lib/.build-id/da/e8d881d6ada1fc2d0ffe2e10e2447d941e9d75
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.25
/usr/share/gcc-8
/usr/share/gcc-8/python
/usr/share/gcc-8/python/libstdcxx
/usr/share/gcc-8/python/libstdcxx/__init__.py
/usr/share/gcc-8/python/libstdcxx/__pycache__
/usr/share/gcc-8/python/libstdcxx/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/share/gcc-8/python/libstdcxx/__pycache__/__init__.cpython-36.pyc
/usr/share/gcc-8/python/libstdcxx/v6
/usr/share/gcc-8/python/libstdcxx/v6/__init__.py
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/__init__.cpython-36.pyc
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/printers.cpython-36.opt-1.pyc
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/printers.cpython-36.pyc
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/xmethods.cpython-36.opt-1.pyc
/usr/share/gcc-8/python/libstdcxx/v6/__pycache__/xmethods.cpython-36.pyc
/usr/share/gcc-8/python/libstdcxx/v6/printers.py
/usr/share/gcc-8/python/libstdcxx/v6/xmethods.py
/usr/share/gdb
/usr/share/gdb/auto-load
/usr/share/gdb/auto-load/usr
/usr/share/gdb/auto-load/usr/lib64
/usr/share/gdb/auto-load/usr/lib64/__pycache__
/usr/share/gdb/auto-load/usr/lib64/__pycache__/libstdc++.so.6.0.25-gdb.cpython-36.opt-1.pyc
/usr/share/gdb/auto-load/usr/lib64/__pycache__/libstdc++.so.6.0.25-gdb.cpython-36.pyc
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.25-gdb.py

References

Summary

In this tutorial we learn how to install libstdc++ on Rocky Linux 8 using yum and dnf.