You can use dnf to upgrade it - dnf update -y glibc.
Full example from a container on my machine:
[root@0df679e04d17 /]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.2 (Ootpa)
[root@0df679e04d17 /]# rpm -qa glibc
glibc-2.28-101.el8.x86_64
[root@50a1768b4fcf /]# dnf update glibc
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Red Hat Universal Base Image 8 (RPMs) - BaseOS 1.1 MB/s | 827 kB 00:00
Red Hat Universal Base Image 8 (RPMs) - AppStream 3.7 MB/s | 3.2 MB 00:00
Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder 138 kB/s | 29 kB 00:00
Dependencies resolved.
=====================================================================================================================================================================================================================
Package Architecture Version Repository Size
=====================================================================================================================================================================================================================
Upgrading:
glibc x86_64 2.28-211.el8 ubi-8-baseos 2.2 M
glibc-common x86_64 2.28-211.el8 ubi-8-baseos 1.0 M
glibc-minimal-langpack x86_64 2.28-211.el8 ubi-8-baseos 63 k
Installing weak dependencies:
glibc-gconv-extra x86_64 2.28-211.el8 ubi-8-baseos 1.5 M
glibc-langpack-en x86_64 2.28-211.el8 ubi-8-baseos 825 k
Transaction Summary
=====================================================================================================================================================================================================================
Install 2 Packages
Upgrade 3 Packages
Total download size: 5.6 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): glibc-minimal-langpack-2.28-211.el8.x86_64.rpm 401 kB/s | 63 kB 00:00
(2/5): glibc-langpack-en-2.28-211.el8.x86_64.rpm 2.5 MB/s | 825 kB 00:00
(3/5): glibc-common-2.28-211.el8.x86_64.rpm 1.7 MB/s | 1.0 MB 00:00
(4/5): glibc-gconv-extra-2.28-211.el8.x86_64.rpm 1.6 MB/s | 1.5 MB 00:00
(5/5): glibc-2.28-211.el8.x86_64.rpm 1.8 MB/s | 2.2 MB 00:01
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 4.0 MB/s | 5.6 MB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : glibc-gconv-extra-2.28-211.el8.x86_64 1/8
Running scriptlet: glibc-gconv-extra-2.28-211.el8.x86_64 1/8
Upgrading : glibc-common-2.28-211.el8.x86_64 2/8
Running scriptlet: glibc-2.28-211.el8.x86_64 3/8
Upgrading : glibc-2.28-211.el8.x86_64 3/8
Running scriptlet: glibc-2.28-211.el8.x86_64 3/8
Installing : glibc-langpack-en-2.28-211.el8.x86_64 4/8
Upgrading : glibc-minimal-langpack-2.28-211.el8.x86_64 5/8
Cleanup : glibc-minimal-langpack-2.28-101.el8.x86_64 6/8
Cleanup : glibc-2.28-101.el8.x86_64 7/8
Cleanup : glibc-common-2.28-101.el8.x86_64 8/8
Running scriptlet: glibc-common-2.28-101.el8.x86_64 8/8
Running scriptlet: glibc-common-2.28-211.el8.x86_64 8/8
Verifying : glibc-langpack-en-2.28-211.el8.x86_64 1/8
Verifying : glibc-gconv-extra-2.28-211.el8.x86_64 2/8
Verifying : glibc-minimal-langpack-2.28-211.el8.x86_64 3/8
Verifying : glibc-minimal-langpack-2.28-101.el8.x86_64 4/8
Verifying : glibc-2.28-211.el8.x86_64 5/8
Verifying : glibc-2.28-101.el8.x86_64 6/8
Verifying : glibc-common-2.28-211.el8.x86_64 7/8
Verifying : glibc-common-2.28-101.el8.x86_64 8/8
Installed products updated.
Upgraded:
glibc-2.28-211.el8.x86_64 glibc-common-2.28-211.el8.x86_64 glibc-minimal-langpack-2.28-211.el8.x86_64
Installed:
glibc-gconv-extra-2.28-211.el8.x86_64 glibc-langpack-en-2.28-211.el8.x86_64
Complete!
[root@0df679e04d17 /]# rpm -qa glibc
glibc-2.28-211.el8.x86_64
Answer from Mureinik on Stack Exchangec - How to install latest glibc (version 2.29) beside system installed one & compile a program? - Stack Overflow
Upgrade glibc_2.28 to 2.29
Cannot install Warp on Red Hat Enterprise Linux release 8.9 (Ootpa) due to GLIBC 2.29 requirement
How to install GLIBC version 2.29 in the Linux Binary Compat layer? | The FreeBSD Forums
First of all, don't put an alternate libc (or alternate version of your libc) in a path searched by the normal include and library search (both link-time and runtime library search) for your main system one. This is a recipe for disaster. Installing a different glibc in /usr/local/ does avoid clobbering your system one, but now you just have two installed in places where the same tools can see and use them.
To do this right, you really need a full separate toolchain (gcc, binutils) in some completely separate path (like ~/my_glibc_root/... or /opt/alt_glibc_root/...). I'm not sure if there's a recommended way to do this. The glibc build procedures in Linux From Scratch might be a good place to look for ideas. In theory it can be done in a single stage; I do that with musl libc in musl-cross-make by careful use of intermediate make rules in the gcc build system. But applying the same idea to glibc probably requires some extra care.
Second Try Command: In second try, I am using "-I" & "-L" GCC command options.
gcc -Wall -g -I/usr/local/glibc/include -o main main.c -L/usr/local/glibc/lib -Wl,--rpath=/usr/local/glibc/lib -Wl,--dynamic-linker=/usr/local/glibc/lib/ld-linux-x86-64.so.2
This command is almost correct. The thrd_create and thrd_join functions are defined in libpthread, which you didn't link against.
Add -pthread to your compile command, and the link should succeed.
P.S. R's advice of not installing alternate GLIBC into /usr/local is also a good one.
Hello everyone,
Is there a safe way to install older glibc on redhat 8 so I can get legacy applications that support older rhel 7 to run?
I was able to install the older rpm into a second directory, but when I tried to launch the application, it didn't use that glibc. If I try to ld_library_path, it breaks everything else since, of course, rhel 8 uses newer system glibc. Is there a way around this? Or do I need to use chroot or container of centos7?
Thanks
I am trying to run a simple graphical application. Upon running it via the Terminal, it prompts me with an information that GLIBC 2.29 is not found on the system, because Switchroot Ubuntu runs a slightly lower version by default. I attempted to update it using instructions I found online for that, which essentially boil to building it on my own machine, but they ended up with an error at some point. Does anyone know how to perform this correctly on Ubuntu 18.04 for Nintendo Switch OLED?
You can try to download glibc from the official source and install it:
wget -c https://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.gz
tar -zxvf glibc-2.29.tar.gz
mkdir glibc-2.29/build
cd glibc-2.29/build
../configure --prefix=/opt/glibc
make
make install
Pay attention to avoid breaking your OS environment: you need to specify the prefix and configure the separate path when you are using it.
See this answer on how to use the alternate GLIBC.
Answer from @Dolphin isn't complete as it produces error from make: Makeconfig:42: *** missing separator. Stop.
In my case, to I had to do following:
# Check GLIBC_2.29
ldd --version | head -n1
# Build GLIBC_2.29 from sources
sudo apt-get install gawk bison -y
wget -c https://ftp.gnu.org/gnu/glibc/glibc-2.34.tar.gz
tar -zxvf glibc-2.34.tar.gz && cd glibc-2.34
mkdir glibc-build && cd glibc-build
../configure --prefix=/opt/glibc-2.34
make
sudo make install
P.S. If you are trying to run ord just try building from sources, it's much simpler than upgrading ubuntu or recompiling GLIBC