How to install glibc package version 2.28+ on RHEL 7 unofficially for testing purposes?
In this post, we will see an interesting topic how to install glibc package version 2.28 on RHEL 7 or CentOS 7.
CentOS or RHEL does not officially support this and provides glibc version 2.17 as official version.
Since these packages affect the core OS, upgrading unofficial version makes your OS out of support.
However in some scenarios we need this version for testing.
Hence i thought to put this trick here.
1. Download glibc 2.28 packages.
[root@ngelinux001 ~]# wget http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/glibc-devel-2.28-158.el8.x86_64.rpm --2022-05-12 04:37:43-- http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/glibc-devel-2.28-158.el8.x86_64.rpm Resolving mirror.centos.org (mirror.centos.org)... 198.15.72.18, 2600:1f14:fad:5c02:ccad:ce61:a8ed:ba90 Connecting to mirror.centos.org (mirror.centos.org)|198.15.72.18|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1075944 (1.0M) [application/x-rpm] Saving to: 'glibc-devel-2.28-158.el8.x86_64.rpm' 100%[====================================================================================>] 1,075,944 --.-K/s in 0.1s 2022-05-12 04:37:43 (7.12 MB/s) - 'glibc-devel-2.28-158.el8.x86_64.rpm' saved [1075944/1075944] [root@ngelinux001 ~]# wget https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/nscd-2.28-158.el8.x86_64.rpm --2022-05-12 04:39:26-- https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/nscd-2.28-158.el8.x86_64.rpm Resolving rpmfind.net (rpmfind.net)... 195.220.108.108 Connecting to rpmfind.net (rpmfind.net)|195.220.108.108|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 135432 (132K) [application/x-rpm] Saving to: 'nscd-2.28-158.el8.x86_64.rpm' 100%[====================================================================================>] 135,432 270KB/s in 0.5s 2022-05-12 04:39:27 (270 KB/s) - 'nscd-2.28-158.el8.x86_64.rpm' saved [135432/135432] [root@ngelinux001 ~]# [root@ngelinux001 eag]# wget http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/glibc-common-2.28-164.el8.x86_64.rpm --2022-05-12 04:31:01-- http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/glibc-common-2.28-164.el8.x86_64.rpm Resolving mirror.centos.org (mirror.centos.org)... 67.222.128.246, 2604:1580:fe02:2::10 Connecting to mirror.centos.org (mirror.centos.org)|67.222.128.246|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1378856 (1.3M) [application/x-rpm] Saving to: ‘glibc-common-2.28-164.el8.x86_64.rpm’ 100%[====================================================================================>] 1,378,856 4.55MB/s in 0.3s 2022-05-12 04:31:01 (4.55 MB/s) - ‘glibc-common-2.28-164.el8.x86_64.rpm’ saved [1378856/1378856] [root@ngelinux001 eag]# wget http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/glibc-langpack-sw-2.28-199.el8.x86_64.rpm --2022-05-12 04:31:11-- http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/glibc-langpack-sw-2.28-199.el8.x86_64.rpm Resolving mirror.centos.org (mirror.centos.org)... 67.222.128.246, 2604:1580:fe02:2::10 Connecting to mirror.centos.org (mirror.centos.org)|67.222.128.246|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 397584 (388K) [application/x-rpm] Saving to: ‘glibc-langpack-sw-2.28-199.el8.x86_64.rpm’ 100%[====================================================================================>] 397,584 1.58MB/s in 0.2s 2022-05-12 04:31:11 (1.58 MB/s) - ‘glibc-langpack-sw-2.28-199.el8.x86_64.rpm’ saved [397584/397584] [root@ngelinux001 eag]#
2. Installing the packages one by one.
[root@ngelinux001 eag]# rpm -ivh ./glibc-langpack-sw-2.28-199.el8.x86_64.rpm --nodeps warning: ./glibc-langpack-sw-2.28-199.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY Preparing... ################################# [100%] Updating / installing... 1:glibc-langpack-sw-2.28-199.el8 ################################# [100%] [root@ngelinux001 eag]# [root@ngelinux001 ~]# rpm -ivh glibc-devel-2.28-158.el8.x86_64.rpm nscd-2.28-158.el8.x86_64.rpm --nodeps --force warning: glibc-devel-2.28-158.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY Preparing... ################################# [100%] Updating / installing... 1:nscd-2.28-158.el8 warning: /etc/nscd.conf created as /etc/nscd.conf.rpmnew ################################# [ 50%] 2:glibc-devel-2.28-158.el8 ################################# [100%] [root@ngelinux001 ~]# [root@ngelinux001 eag]# rpm -ivh ./glibc-common-2.28-164.el8.x86_64.rpm --nodeps --force warning: ./glibc-common-2.28-164.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY Preparing... ################################# [100%] Updating / installing... 1:glibc-common-2.28-164.el8 ################################# [100%] [root@ngelinux001 eag]#
3. Link new installed binaries
[root@ngelinux001 lib]# pwd /lib [root@ngelinux001 lib]# ls -ltr | grep -i '2.17.so' -rwxr-xr-x. 1 root root 40348 Jun 16 2017 librt-2.17.so -rwxr-xr-x. 1 root root 22484 Jun 16 2017 libnss_hesiod-2.17.so -rwxr-xr-x. 1 root root 36104 Jun 16 2017 libnss_db-2.17.so -rwxr-xr-x. 1 root root 159636 Jun 16 2017 ld-2.17.so -rwxr-xr-x. 1 root root 13128 Jun 16 2017 libutil-2.17.so -rwxr-xr-x. 1 root root 63104 Jun 16 2017 libnss_nisplus-2.17.so -rwxr-xr-x. 1 root root 40296 Jun 16 2017 libnss_compat-2.17.so -rwxr-xr-x. 1 root root 110240 Jun 16 2017 libnsl-2.17.so -rwxr-xr-x. 1 root root 34924 Jun 16 2017 libcrypt-2.17.so -rwxr-xr-x. 1 root root 14156 Jun 16 2017 libanl-2.17.so -rwxr-xr-x. 1 root root 7596 Jun 16 2017 libBrokenLocale-2.17.so -rwxr-xr-x. 1 root root 136388 Jun 16 2017 libpthread-2.17.so -rwxr-xr-x. 1 root root 50088 Jun 16 2017 libnss_nis-2.17.so -rwxr-xr-x. 1 root root 195444 Jun 16 2017 libcidn-2.17.so -rwxr-xr-x. 1 root root 2079172 Jun 16 2017 libc-2.17.so -rwxr-xr-x. 1 root root 104220 Jun 16 2017 libresolv-2.17.so -rwxr-xr-x. 1 root root 55024 Jun 16 2017 libnss_files-2.17.so -rwxr-xr-x. 1 root root 25996 Jun 16 2017 libnss_dns-2.17.so -rwxr-xr-x. 1 root root 307128 Jun 16 2017 libm-2.17.so -rwxr-xr-x. 1 root root 18200 Jun 16 2017 libdl-2.17.so lrwxrwxrwx. 1 root root 10 Apr 21 23:35 ld-linux.so.2 -> ld-2.17.so lrwxrwxrwx. 1 root root 23 Apr 21 23:35 libBrokenLocale.so.1 -> libBrokenLocale-2.17.so lrwxrwxrwx. 1 root root 14 Apr 21 23:35 libanl.so.1 -> libanl-2.17.so lrwxrwxrwx. 1 root root 12 Apr 21 23:35 libc.so.6 -> libc-2.17.so lrwxrwxrwx. 1 root root 15 Apr 21 23:35 libcidn.so.1 -> libcidn-2.17.so lrwxrwxrwx. 1 root root 16 Apr 21 23:35 libcrypt.so.1 -> libcrypt-2.17.so lrwxrwxrwx. 1 root root 13 Apr 21 23:35 libdl.so.2 -> libdl-2.17.so lrwxrwxrwx. 1 root root 12 Apr 21 23:35 libm.so.6 -> libm-2.17.so lrwxrwxrwx. 1 root root 14 Apr 21 23:35 libnsl.so.1 -> libnsl-2.17.so lrwxrwxrwx. 1 root root 21 Apr 21 23:35 libnss_compat.so.2 -> libnss_compat-2.17.so lrwxrwxrwx. 1 root root 17 Apr 21 23:35 libnss_db.so.2 -> libnss_db-2.17.so lrwxrwxrwx. 1 root root 18 Apr 21 23:35 libnss_dns.so.2 -> libnss_dns-2.17.so lrwxrwxrwx. 1 root root 20 Apr 21 23:35 libnss_files.so.2 -> libnss_files-2.17.so lrwxrwxrwx. 1 root root 21 Apr 21 23:35 libnss_hesiod.so.2 -> libnss_hesiod-2.17.so lrwxrwxrwx. 1 root root 18 Apr 21 23:35 libnss_nis.so.2 -> libnss_nis-2.17.so lrwxrwxrwx. 1 root root 22 Apr 21 23:35 libnss_nisplus.so.2 -> libnss_nisplus-2.17.so lrwxrwxrwx. 1 root root 18 Apr 21 23:35 libpthread.so.0 -> libpthread-2.17.so lrwxrwxrwx. 1 root root 17 Apr 21 23:35 libresolv.so.2 -> libresolv-2.17.so lrwxrwxrwx. 1 root root 13 Apr 21 23:35 librt.so.1 -> librt-2.17.so lrwxrwxrwx. 1 root root 15 Apr 21 23:35 libutil.so.1 -> libutil-2.17.so [root@ngelinux001 lib]#
Here we need to change all the links from 2.17.so library to 2.28 libraries exists in /usr/lib64 or /lib64 directory.
We need to delete all these links and create new ones.