Do not install libc6 2.31-9 from Debian 11 ( bullseye ) on debian 10 (libc6 2.28-10), this will break your system. Upgrading to bullseye is more safe.
glibc - Cannot install libc6 ver 2.29 /newer on debian buster - Stack Overflow
How to install GLIBC 2.29 or higher in Ubuntu 18.04 - Stack Overflow
How do you upgrade glibc on Debian? - Stack Overflow
Deltachat 0.104 on Debian Buster: glibc 2.29 error. Solved
Disclaimer:
Some reported that their systems crashed after using this answer.
So anyone who is trying this, please be careful and make sure you create backups before trying it.
To my knowledge, libc6 2.29 is the latest version. And it is available for Ubuntu 19.04 (link).
If you want to install libc6 amd64, open this link to download it, then open the download folder in the terminal and run sudo dpkg -i libc6_2.29-0ubuntu2_amd64.deb
If you want to install libc6 i386, you can download it from this link, then open the download folder in the terminal and run sudo dpkg -i libc6_2.29-0ubuntu2_i386.deb
EDIT 06/01/2020:
As per now, libc6_2.29 does not exist anymore. However libc6_2.30 and lib6_2.31 are available via this link (2.31 is the official version for Ubuntu 20.04).
If you want to download a different version than the official one supported by your Ubuntu release (i.e 2.27 for 18.04, 2.30 for Ubuntu 19.10 ...) check this link.
Download the version that suits you, then open the download folder and run sudo dpkg -i <the_file_name>.
Don't do it. Here I'll leave an image of how dependent are your software packages on libc6 compiled for that specific library!!! https://sites.google.com/view/dependency-netwok/.
There you'll see a star shaped network and the node at the center (green colored) represents libc6. I suggest two possible solutions to your problem:
1. Add a compatible repository
Since it is r-base-core what you want, change the repository to a compatible one for your specific distribution.
For example: deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
In your /etc/apt/sources.list file. By using you will be automatically be redirected to a nearby CRAN mirror. See https://cran.r-project.org/mirrors.html for the current list of CRAN mirrors.
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-recommended
2. Upgrade
Another solution would be to upgrade your entire distribution to a more recent and compatible with what you want.
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
I was able to install libc6 2.17 in Debian Wheezy by editing the recommendations in perror's answer:
IMPORTANT
You need to exit out of your display manager by pressing CTRL+ALT+F1.
Then you can stop x (slim) with sudo /etc/init.d/slim stop
(replace slim with mdm or lightdm or whatever)
Add the following line to the file /etc/apt/sources.list:
deb http://ftp.debian.org/debian experimental main
Should be changed to:
deb http://ftp.debian.org/debian sid main
Then follow the rest of perror's post:
Update your package database:
apt-get update
Install the glibc package:
apt-get -t sid install libc6-amd64 libc6-dev libc6-dbg
IMPORTANT
After updating libc6, restart the computer, and you should comment out or remove the sid source you just added (deb http://ftp.debian.org/debian sid main), or else you risk upgrading your whole distro to sid.
Your script contains errors as well, for example if you have dos2unix installed your install works but if you don't like I did then it will fail with dependency issues.
I found this by accident as I was making a script file of this to give to my friend who is new to Linux and because I made the scripts on windows I directed him to install it, at the time I did not have dos2unix installed thus I got errors.
here is a copy of the script I made for your solution but have dos2unix installed.
#!/bin/sh
echo "deb http://ftp.debian.org/debian sid main" >> /etc/apt/sources.list
apt-get update
apt-get -t sid install libc6 libc6-dev libc6-dbg
echo "Please remember to hash out sid main from your sources list. /etc/apt/sources.list"
this script has been tested on 3 machines with no errors.
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.
It turns out I was just not familiar enough with apt-get. I managed to install the necessary glibc version by issuing the following command:
apt-get install libc-bin=2.13-38+deb7u4 libc6=2.13-38+deb7u4
I even downgraded it and everything works okay. Core dump analysis works now.
I wouldn't install it, but unpack it in some work directory and refer to it via LD_LIBRARY_PATH. Downgrading your libc6 package can be quite problematic.
Your customer should be able to supply you with their libc6 version. It might, however, be advisable to use the libc6-dbg package which includes debug symbols. Unfortunately the 7u4 version is an older one and not available anymore.