I try to get a more up to date version of bash
from LinuxMint
.
I have a chroot
with Debian Sid
in my box.
What I try to do in a bash
wrapper script, early in my PATH
#!/bin/bash
LD_LIBRARY_PATH=/path/to/chroot/usr/lib/x86_64-linux-gnu:/path/to/chroot/lib:/path/to/chroot/lib64:/path/to/chroot/var/lib:/path/to/chroot/usr/lib:/path/to/chroot/usr/local/lib /path/to/chroot/bin/bash "$@"
But I get:
/home/mevatlave/bin/bash: line 3: 1492488 Segmentation fault (core dumped) LD_LIBRARY_PATH=/path/to/chroot/usr/lib/x86_64-linux-gnu:/path/to/chroot/lib:/path/to/chroot/lib64:/path/to/chroot/var/lib:/path/to/chroot/usr/lib:/path/to/chroot/usr/local/lib /path/to/chroot/bin/bash "$@"
From the chroot:
% ldd /bin/bash
linux-vdso.so.1 (0x00007fff237fc000)
libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f94de839000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f94de658000)
/lib64/ld-linux-x86-64.so.2 (0x00007f94de9af000)
Is it feasible?
EDIT:
With
LD_LIBRARY_PATH=/path/to/chroot/lib:/path/to/chroot/lib64:/path/to/chroot/var/lib:/path/to/chroot/usr/lib:/path/to/chroot/usr/local/lib /path/to/chroot/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /path/to/chroot/bin/bash "$@"
I get
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.36' not found
With
LD_LIBRARY_PATH=/path/to/chroot/usr/lib/x86_64-linux-gnu:/path/to/chroot/lib:/path/to/chroot/lib64:/path/to/chroot/var/lib:/path/to/chroot/usr/lib:/path/to/chroot/usr/local/lib /path/to/chroot/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /path/to/chroot/bin/bash "$@"
I get:
Segmentation fault (core dumped)
LD_LIBRARY_PATH=/path/to/chroot/usr/lib/x86_64-linux- gnu:/path/to/chroot/lib:/path/to/chroot/lib64:/path/to/chroot/var/lib:/path/to/chroot/usr/lib:/path/to/chroot/usr/local/lib: /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /path/to/chroot/bin/bash "$@"
EDIT2:
I can run this one:
#!/bin/bash
LANG=C
LD_LIBRARY_PATH=/path/to/chroot/usr/lib/x86_64-linux-gnu:/path/to/chroot/lib:/path/to/chroot/lib64:/path/to/chroot/var/lib:/path/to/chroot/usr/lib:/path/to/chroot/usr/local/lib /path/to/chroot/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /path/to/chroot/bin/bash "$@"
But when I run bash --version
, I get:
Segmentation fault (core dumped)
root@debian-sid_chroot:/# dpkg -l | grep libc6
ii libc6:amd64 2.36-8 amd64 GNU C
Library: Shared libraries
ii libc6-dev:amd64 2.36-8 amd64 GNU C
Library: Development Libraries and Header Files
LD_LIBRARY_PATH=/path/to/chroot/usr/lib/x86_64-linux-gnu:/path/to/chroot/lib:/path/to/chroot/lib64:/path/to/chroot/var/lib:/path/to/chroot/usr/lib:/path/to/chroot/usr/local/lib ldd /path/to/chroot/bin/bash
show? – Stephen Kitt Mar 05 '23 at 21:10/lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.36' not found (required by /path/to/chroot/bin/bash) linux-vdso.so.1 (0x00007ffd465f4000) libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fae09045000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fae08e1d000) /lib64/ld-linux-x86-64.so.2 (0x00007fae091d3000)
– Mévatlavé Kraspek Mar 05 '23 at 21:52