Error Installing MongoDB 7.0 on CentOS: libc.so.6(GLIBC\_2.34) Required
In this article, we will discuss the issue encountered when trying to install MongoDB 7.0 on CentOS and how to resolve it. We will cover the following key concepts:
- Understanding the error message
- Checking the system's current version of glibc
- Upgrading glibc to a compatible version
- Installing MongoDB 7.0 on CentOS
Understanding the Error Message
When trying to install MongoDB 7.0 on CentOS, you may encounter the following error message:
Error: Package: mongodb-org-mongos-7.0.11-1.el9.x86\_64 (mongodb-org-7.0)
Requires: libc.so.6(GLIBC\_2.34)(64bit)
Error: Package: mongodb-org-server-7.0.11-1.el9.x86\_64 (mongodb-org-7.0)
Requires: libc.so.6(GLIBC\_2.34)(64bit)
This error message indicates that the MongoDB 7.0 package requires a version of glibc (the GNU C Library) that is not currently installed on your system. Specifically, it requires version 2.34 or higher.
Checking the System's Current Version of glibc
To check the current version of glibc installed on your system, you can use the following command:
strings /usr/lib64/libc.so.6 | grep GLIBC
This command will display a list of all the versions of glibc currently installed on your system. If the version is lower than 2.34, then you will need to upgrade it in order to install MongoDB 7.0.
Upgrading glibc to a Compatible Version
Upgrading glibc can be a complex process and should only be done if you are comfortable with advanced system administration tasks. Before upgrading, make sure to back up all important data and create a system restore point.
To upgrade glibc, you can use the following steps:
- Download the latest version of glibc from the official website.
- Extract the downloaded package using the following command:
tar -xvf glibc-2.34.tar.gz
- Configure and compile the source code using the following commands:
cd glibc-2.34
./configure --prefix=/usr
make
- Install the new version of glibc using the following command:
sudo make install
Once the installation is complete, you can verify the new version of glibc using the following command:
strings /usr/lib64/libc.so.6 | grep GLIBC
Installing MongoDB 7.0 on CentOS
Now that you have upgraded glibc to a compatible version, you can proceed with installing MongoDB 7.0 on CentOS using the following steps:
- Add the MongoDB repository using the following command:
sudo tee /etc/yum.repos.d/mongodb-org-7.0.repo <<EOF
[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/7.0/x86\_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-7.0.asc
EOF
- Install the MongoDB package using the following command:
sudo yum install mongodb-org
In this article, we discussed the issue encountered when trying to install MongoDB 7.0 on CentOS and how to resolve it. We covered the following key concepts:
- Understanding the error message
- Checking the system's current version of glibc
- Upgrading glibc to a compatible version
- Installing MongoDB 7.0 on CentOS