Cyberithub

How do I install the linux library libc.so.6 in 5 Easy Steps

Advertisements

In this article, I will take you through the steps to install libc.so.6 library package on Linux. libc is commonly referred as the shorthand for the Standard C library. It is available in different standard format in which the most popular and most widely used is glibc, also known as GNU C Library. Today it is being used in almost all the famous Linux distributions. glibc library is most commonly available in Linux system as symbolic link /lib/libc.so.6 which points to the glibc library itself.

Most of the times you will find this library installed in your System however there are sometimes when you will see libc.so.6 missing error in your System either due to non-availability of symbolic link to the library or due to missing of the library package itself. If you are also facing this issue, then here we are going to look into the steps to solve that kind of error.

 

How do I install the linux library libc.so.6 in 5 Easy Steps

How do I install the linux library libc.so.6 in 5 Easy Steps

Also Read: How to Install MySQL on Ubuntu 20.04 LTS (Focal Fossa)

Step 1: Prerequisites

a) You should have a running Linux System.

b) You should have sudo or root access to run privileged commands.

c) You should have a package manager available in your System.

 

Step 2: Update Your Server

In the first step, it is always recommended to update and if needed upgrade your System packages to the latest version to avoid any broken package dependency or any other such issues. You can use below command depending on the Linux distribution you are using.

a) On Ubuntu/Debian System

If you are using Ubuntu/Debian based systems then you need to use sudo apt update && sudo apt upgrade command as shown below.

cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade
Get:1 https://dl.google.com/linux/chrome/deb stable InRelease [1,811 B]
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:3 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:4 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:5 https://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,078 B]
Get:6 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages [530 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2,258 kB]
Get:9 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1,885 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [309 kB]
Get:11 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [40.8 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [11.4 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1,360 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [192 kB]
Get:15 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [777 kB]
Get:16 http://security.ubuntu.com/ubuntu focal-security/universe i386 Packages [573 kB]
Get:17 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [149 kB]
Get:18 http://in.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [761 kB]
Get:19 http://in.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [393 kB]
Get:20 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [274 kB]
Get:21 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [16.1 kB]
Get:22 http://in.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [1,453 kB]
Get:23 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [94.1 kB]
Get:24 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [16.8 kB]
.......................................................

b) On RHEL/CentOS System

If you are using RHEL/CentOS based systems then you can either use sudo dnf update && sudo dnf upgrade or sudo yum update && sudo yum upgrade command as shown below.

[cyberithub@centos8 ~]$ sudo dnf update && sudo dnf upgrade
Last metadata expiration check: 0:05:34 ago on Thu 01 Dec 2022 02:52:03 PM EST.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Upgrading:
epel-release noarch 8-18.el8 epel 24 k

Transaction Summary
=============================================================================================================================================================
Upgrade 1 Package

Total download size: 24 k
Is this ok [y/N]: Y
Downloading Packages:
epel-release-8-18.el8.noarch.rpm 97 kB/s | 24 kB 00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 39 kB/s | 24 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 73 kB/s | 1.6 kB 00:00
Importing GPG key 0x2F86D6A1:
Userid : "Fedora EPEL (8) <epel@fedoraproject.org>"
Fingerprint: 94E2 79EB 8D8F 25B2 1810 ADF1 21EA 45AB 2F86 D6A1
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
Is this ok [y/N]: Y
.........................................

 

Step 3: Install libc.so.6 library

You can install libc library using below command depending on the Linux distribution you are using.

a) On Ubuntu/Debian System

If you are using Ubuntu/Debian based 64-bit architecture then you need to use sudo apt install libc6 command to install the library package from default Ubuntu repo along with all its dependencies. Since in our case it already has the latest version available so it won't do anything further.

cyberithub@ubuntu:~$ sudo apt install libc6
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6 is already the newest version (2.31-0ubuntu9.9).
libc6 set to manually installed.
The following packages were automatically installed and are no longer required:
libfwupdplugin1 libllvm11 libxmlb1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.

Similarly, If you are using Ubuntu/Debian based 32-bit architecture then you need to use sudo apt install libc6-i386 command to install the library package from default Ubuntu repo along with all its dependencies as shown below.

cyberithub@ubuntu:~$ sudo apt install libc6-i386
[sudo] password for cyberithub:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libfwupdplugin1 libllvm11 libxmlb1
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
libc6-i386
0 upgraded, 1 newly installed, 0 to remove and 24 not upgraded.
Need to get 2,730 kB of archives.
After this operation, 14.8 MB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 libc6-i386 amd64 2.31-0ubuntu9.9 [2,730 kB]
Fetched 2,730 kB in 3s (981 kB/s)
Selecting previously unselected package libc6-i386.
(Reading database ... 182609 files and directories currently installed.)
Preparing to unpack .../libc6-i386_2.31-0ubuntu9.9_amd64.deb ...
Unpacking libc6-i386 (2.31-0ubuntu9.9) ...
Setting up libc6-i386 (2.31-0ubuntu9.9) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...

b) On RHEL/CentOS System

If you are using 64-bit RHEL/CentOS systems then you need to either use sudo dnf install glibc or sudo yum install glibc command as shown below.

[cyberithub@centos8 ~]$ sudo dnf install glibc
Last metadata expiration check: 0:02:23 ago on Thu 01 Dec 2022 02:52:03 PM EST.
Package glibc-2.28-164.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Similarly, if you are using 32-bit RHEL/CentOS based systems then you need to either use sudo dnf install glibc.i686 or sudo yum install glibc.i686 command as shown below.

[cyberithub@centos8 ~]$ sudo dnf install glibc.i686
[sudo] password for cyberithub:
Last metadata expiration check: 10:24:38 ago on Thu 01 Dec 2022 02:51:56 PM EST.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Installing:
glibc i686 2.28-164.el8 baseos 3.4 M

Transaction Summary
=============================================================================================================================================================
Install 1 Package

Total download size: 3.4 M
Installed size: 13 M
Is this ok [y/N]: y
Downloading Packages:
glibc-2.28-164.el8.i686.rpm 2.7 MB/s | 3.4 MB 00:01
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.7 MB/s | 3.4 MB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: glibc-2.28-164.el8.i686 1/1
Installing : glibc-2.28-164.el8.i686 1/1
Running scriptlet: glibc-2.28-164.el8.i686 1/1
Verifying : glibc-2.28-164.el8.i686 1/1

Installed:
glibc-2.28-164.el8.i686

Complete!

 

Step 4: Verify Installation

After successful installation, you can verify the installed package by using below command depending on the Linux distribution you are using.

a) On Ubuntu/Debian System

To verify the installation on 64-bit architecture, you can use dpkg -L libc6 | grep -i lbc.so.6 command as shown below. Similarly, you can verify the installation on 32-bit architecture as well.

cyberithub@ubuntu:~$ dpkg -L libc6 | grep -i libc.so.6
/lib/x86_64-linux-gnu/libc.so.6

b) On RHEL/CentOS System

You can verify the installed glibc package on 64-bit system by running rpm -qa | grep -i glibc command as shown below. Similarly, you can verify the installation on 32-bit architecture as well.

[cyberithub@centos8 ~]$ rpm -qa | grep -i glibc
glibc-langpack-en-2.28-164.el8.x86_64
glibc-common-2.28-164.el8.x86_64
glibc-2.28-164.el8.x86_64

You can also check the location path of libc.so.6 using whereis libc.so.6 command as shown below.

[cyberithub@centos8 ~]$ whereis libc.so.6
libc.so: /usr/lib64/libc.so.6

 

Step 5: Installed but missing libc.so.6

Many times you might get missing libc.so.6 error even though glibc library package is already installed in your System. This could mostly happen due to two reasons which you can see below.

a) Missing Soft Link

Sometimes you might observed that glibc library is installed in your system but still you are getting libc.so.6 missing error. This is mostly due to missing of soft link which should be available on /libc/libc.so.6 path. To solve this error, you can run below command depending on the system architecture you are having.

On 64-bit System:-

sudo ln -s /lib64/x86_64-linux-gnu/libc.so.6 /lib64/libc.so.6

On 32-bit System:-

sudo ln -s /lib/i386-linux-gnu/libc.so.6 /lib/libc.so.6

b) Library Path not set

Sometimes you may face a situation where you are trying to install certain application through source code and while configuring that application you will see LD_LIBRARY_PATH parameter not set error. To fix this error, you need to first go to your home folder and edit .profile using your favorite editor.

cyberithub@ubuntu:~$ nano .profile

Then add below line at the end of the file.

export LD_LIBRARY_PATH=/usr/local/lib

where, /usr/local/lib is your library path. This path could be different for you. You can change it accordingly. Then save and exit by pressing Ctrl + X.

Finally, execute sudo ldconfig command to creates the necessary links and cache to the most recent shared libraries.

cyberithub@ubuntu:~$ sudo ldconfig

This should solve your error.

Leave a Comment