{"id":2359,"date":"2023-03-01T18:11:59","date_gmt":"2023-03-02T01:11:59","guid":{"rendered":"https:\/\/www.itayemi.com\/blog\/?p=2359"},"modified":"2023-03-02T15:06:39","modified_gmt":"2023-03-02T22:06:39","slug":"upgrading-rhel-centos-v-7-x-to-glibc-version-2-20","status":"publish","type":"post","link":"https:\/\/www.itayemi.com\/blog\/2023\/03\/01\/upgrading-rhel-centos-v-7-x-to-glibc-version-2-20\/","title":{"rendered":"Upgrading RHEL\/CentOS v 7.x to GLIBC version 2.20"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Compiling GLIBC-2.x from SOURCE RPM Package:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Background: the latest version of GLIBC from RHEL\/CentOS for v7.7 is glibc-2.17. Some software require newer version (2.18 or newer). In the procedure below, I build GLIBC version 2.20 (you can also build version 2.18 using the same procedure).<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Setup VirtualBox v 7.0.6 e.g., on Windows. So RHEL 7.7 on VirtualBox v7.0.6 used to compile glibc-2.20 or glibc-2.18 source RPM is the working combination.<br>Note1: compiling\/rebuilding the glibc-2.18 from source rpm consistently crashed VB v 7.0.4 on Windows)<br><br><\/li>\n\n\n\n<li>Setup RHEL 7.7 from the DVD in a VM<br><br><\/li>\n\n\n\n<li>Configure the Installation DVD (attached to the VM and mounted on \/mnt) as a repo:<br>[root@rhel77c ~]# mount \/dev\/cdrom \/mnt<br>[root@rhel77c ~]# cp \/mnt\/media.repo \/etc\/yum.repos.d\/<br>[root@rhel77c ~]#<br>[root@rhel77c ~]# vi \/etc\/yum.repos.d\/media.repo<br>[root@rhel77c ~]#<br>[root@rhel77c ~]# cat \/etc\/yum.repos.d\/media.repo<br>[InstallMedia]<br>name=Red Hat Enterprise Linux 7.7<br>mediaid=1563892373.442998<br>metadata_expire=-1<br>gpgcheck=0<br>cost=500<br>enabled=1<br>baseurl=file:\/\/\/mnt\/<br>gpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-redhat-release<br><br><\/li>\n\n\n\n<li>Install required packages:<br>[root@rhel77c ~]# yum install -y yum-utils gcc wget rpm-build<br>[root@rhel77c ~]# wget https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm<br>[root@rhel77c ~]# yum localinstall -y epel-release-latest-7.noarch.rpm<br>[root@rhel77c ~]# yum install -y libpng-devel zlib-devel texinfo libselinux-devel audit-libs-devel libcap-devel nss-devel systemtap-sdt-devel<br>[root@rhel77c ~]# wget http:\/\/mirror.centos.org\/centos\/7\/os\/x86_64\/Packages\/gd-2.0.35-26.el7.x86_64.rpm<br>[root@rhel77c ~]# wget http:\/\/mirror.centos.org\/centos\/7\/os\/x86_64\/Packages\/gd-devel-2.0.35-26.el7.x86_64.rpm<br>[root@rhel77c ~]# wget http:\/\/mirror.centos.org\/centos\/7\/os\/x86_64\/Packages\/libstdc++-4.8.5-44.el7.x86_64.rpm<br>[root@rhel77c ~]# wget http:\/\/mirror.centos.org\/centos\/7\/os\/x86_64\/Packages\/libstdc++-static-4.8.5-44.el7.x86_64.rpm<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; Make sure the DVD ISO is attached to the VM and mounted as yum will install dependencies from it:<br>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[root@rhel77c ~]# mount \/dev\/cdrom \/mnt<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install the packages that were just downloaded (above):<br>[root@rhel77c ~]# yum install -y gd* libstdc*<br><br><\/li>\n\n\n\n<li>Download the glibc-2.x source RPM and rebuild it:<br>[root@rhel77c ~]# wget ftp:\/\/ftp.pbone.net\/mirror\/archive.fedoraproject.org\/fedora\/linux\/updates\/21\/SRPMS\/g\/glibc-2.20-8.fc21.src.rpm<br>[root@rhel77c ~]# rpmbuild &#8211;rebuild glibc-2.20-8.fc21.src.rpm<br><br><\/li>\n\n\n\n<li>Some of the Generated RPMs:<br>\/root\/rpmbuild\/RPMS\/x86_64\/glibc-2.20-8.el7.x86_64.rpm<br>\/root\/rpmbuild\/RPMS\/x86_64\/glibc-devel-2.20-8.el7.x86_64.rpm<br>\/root\/rpmbuild\/RPMS\/x86_64\/glibc-headers-2.20-8.el7.x86_64.rpm<br>\/root\/rpmbuild\/RPMS\/x86_64\/glibc-common-2.20-8.el7.x86_64.rpm<br><br><\/li>\n\n\n\n<li>Testing: Upgrade the system&#8217;s GLIBC or transfer the files to another system to upgrade that system&#8217;s GLIBC version e.g.,:<br>[root@rhel77c2 ~]# rpm -qa | grep glibc<br>glibc-2.17-292.el7.x86_64<br>glibc-devel-2.17-292.el7.x86_64<br>glibc-common-2.17-292.el7.x86_64<br>glibc-headers-2.17-292.el7.x86_64<br>[root@rhel77c2 ~]#<br>[root@rhel77c2 ~]# yum localinstall -y glibc-2.20-8.el7.x86_64.rpm glibc-common-2.20-8.el7.x86_64.rpm glibc-devel-2.20-8.el7.x86_64.rpm glibc-headers-2.20-8.el7.x86_64.rpm<br>[root@rhel77c2 ~]#<br>[root@rhel77c2 ~]# rpm -qa | grep glibc<br>glibc-common-2.20-8.el7.x86_64<br>glibc-2.20-8.el7.x86_64<br>glibc-devel-2.20-8.el7.x86_64<br>glibc-headers-2.20-8.el7.x86_64<br>[root@rhel77c2 ~]#<br><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><br>Reference links:<br>https:\/\/github.com\/sclorg\/centos-release-scl<br>https:\/\/centos.pkgs.org\/7\/centos-updates-x86_64\/<br>ftp:\/\/ftp.pbone.net\/mirror\/archive.fedoraproject.org\/fedora\/linux\/updates\/21\/SRPMS\/g\/glibc-2.20-8.fc21.src.rpm<br>ftp:\/\/ftp.pbone.net\/mirror\/archive.fedoraproject.org\/fedora\/linux\/releases\/20\/Fedora\/source\/SRPMS\/g\/glibc-2.18-11.fc20.src.rpm<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">EXTRAS:<br>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Installing GCC v 7.3.1\/8.3.1\/9.3.1 on RHEL\/CENTOS v 7.x via the SCL (Software Collection) repository.<br>In order to gain access to SCLs for CentOS, you need to install the CentOS Linux Software Collections release file. It is part of the CentOS Extras repository (x86_64 only).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">NOTE: RHEL v7.7 comes with gcc version 4.8.5. If you need a newer gcc version, you can install GCC versions 7.3.1\/8.3.1\/9.3.1 via the SCL package &#8220;devtoolset-7&#8221; or &#8220;devtoolset-8&#8221; or &#8220;devtoolset-9&#8221;.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>On a CentOS system, enable the SCL repo with the command &#8220;yum install -y centos-release-scl&#8221;. On a RHEL system, enable the SCL repo with the command:<br>[root@rhel77c ~]# yum install -y http:\/\/mirror.centos.org\/centos\/7\/extras\/x86_64\/Packages\/centos-release-scl-rh-2-3.el7.centos.noarch.rpm<br><br><\/li>\n\n\n\n<li>Install devtoolset-7 and\/or devtoolset-8:<br>[root@rhel77c ~]# yum install -y devtoolset-7<br>[root@rhel77c ~]# yum install -y devtoolset-8<br><br><\/li>\n\n\n\n<li>To install devtoolset-9:<br>[root@rhel77c ~]# yum install -y http:\/\/mirror.centos.org\/centos\/7\/os\/x86_64\/Packages\/source-highlight-3.1.6-6.el7.x86_64.rpm<br>[root@rhel77c ~]# yum install -y devtoolset-9<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">NOTE: devtoolset-7\/8\/9 files are installed in \/opt\/rh\/devtoolset-7\/ (or \/opt\/rh\/devtoolset-8\/ or \/opt\/rh\/devtoolset-9\/ as applicable). So GCC compiler and supporting binaries will be in \/opt\/rh\/devtoolset-7\/root\/usr\/bin\/ (or \/opt\/rh\/devtoolset-8\/root\/usr\/bin\/ or \/opt\/rh\/devtoolset-9\/root\/usr\/bin\/ as applicable).<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In order to use the compiler that comes with the devtoolset, temporarily or permanently adjust your PATH variable so that it is found first before the system&#8217;s default gcc version 4.8.5 e.g.,<br>[root@rhel77c ~]# export PATH=\/opt\/rh\/devtoolset-7\/root\/usr\/bin:$PATH<br>[root@rhel77c ~]# export LD_LIBRARY_PATH=\/opt\/rh\/devtoolset-7\/root\/usr\/lib64\/<br>[root@rhel77c ~]# gcc &#8211;version<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Compiling GLIBC-2.x from SOURCE RPM Package: Background: the latest version of GLIBC from RHEL\/CentOS for v7.7 is glibc-2.17. Some software require newer version (2.18 or newer). In the procedure below, I build GLIBC version 2.20 (you can also build version &hellip; <a href=\"https:\/\/www.itayemi.com\/blog\/2023\/03\/01\/upgrading-rhel-centos-v-7-x-to-glibc-version-2-20\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":336,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1204,1419,1420,1415,1416,1417,1418],"class_list":["post-2359","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-centos","tag-devtoolset","tag-gcc","tag-glibc","tag-glibc-2-20","tag-redhat-linux","tag-scl"],"_links":{"self":[{"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/posts\/2359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/users\/336"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/comments?post=2359"}],"version-history":[{"count":17,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/posts\/2359\/revisions"}],"predecessor-version":[{"id":2378,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/posts\/2359\/revisions\/2378"}],"wp:attachment":[{"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/media?parent=2359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/categories?post=2359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/tags?post=2359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}