What is libstdc++ so 6 in Linux?

libstdc++.so.6 is a shared library that is part of the GNU Standard C++ Library. It implements the standard C++ library functions and classes, such as std::string, std::vector, and std::map. 

This library contains the basic information of the GCC compiler, like the version details. 

This post will elaborate on the basic introduction of Linux’s “libstdc++.so.6”. 

What is the libstdc++.so.6 in Linux?

The “libstdc++” helps to transform the C++ code into the machine language, which can be read and understood by the computer and perform the specified operation. 

Key Features of libstdc++.so.6:

Some key features of libstdc++.so.6 are listed below: 

  • Implements the C++ Standard Library per the ISO standards. 
  • Ensures the primary functions such as input/output streams, standard classes, and functions.
  • Dynamic Linking enables the latest version of the libstdc++.so.6 is being used. 
  • Optimized implementation of the standard data structures and algorithms.
  • Regularly updated to have the updated version of the library.

How to Install libstdc++6 in Linux?

The “libstdc++6” package is included in the repository of various Linux distributions when they are installed on the computer. For the installation of libstdc++6, we have to follow the steps:

Step 1: Update the Packages

First, update all the Linux packages to their latest releases:

$ sudo apt update

In other Linux distributions, the package can be updated using the command:

CentOS-based Linux OS $ sudo yum update
Fedora-based Linux OS$ sudo dnf update

Step 2: Install libstdc++6

Next, install the package of libstdc++6 with the apt package manager:

$ sudo apt install libstdc++6 -y

In other Linux distributions, it can be installed using the commands:

CentOS-based Linux OS $ sudo yum install libstdc++.so.6
Fedora-based Linux OS$ sudo dnf install libstdc++

How to Uninstall libstdc++6 in Linux?

If you are using Ubuntu-based Linux OS and want to delete the “libstdc++6” with all its configuration files:

$ sudo apt purge libstdc++6

From the figure, we can see that many other packages like “apt” depends on “libstdc++6” (lib-apt)

If you are using the Fedora-based or CentOS-based Linux distributions then use the commands:

CentOS-based Linux OS $ sudo yum remove libstdc++.so.6
Fedora-based Linux OS$ sudo dnf -y remove libstdc++


The “libstdc++6” is a dependency package of the GCC compiler, and “libstdc++.so.6” is the symbolic link that points to the GCC path. The “libstdc++” package is a dependency package of “GCC” and other packages like an apt package manager. In this blog, information about the “libstdc++6” package has been explored, and its installation method has been explored for Linux distributions.