how to change shared library priorities

If none of the more specific forums is the right place to ask

how to change shared library priorities

Postby MagicPoulp » 2020-06-15 13:48

I would like to have 2 versions of a package libc6 installed simultaneously, or a way to install temporarily and then revert.

The reason for this is that android tools need java 8. I built openjdk-8-jdk from source, but it required g++-10 which requires libc6=2.30-8, which is a newer version than stable has,

Maybe I can think libc6 is backward compatible. But it is risky and could break my system.

One way is to change LD_LIBRARY_PATH in the shell? THis seems the best option.

One way is to install a certain version
apt-get install -t unstable libc6 libcrypt1 libgcc-s1
and then put back the stable version:
apt-get install -t unstable libc6=2.28-10 libcrypt1=2.28-10 libgcc-s1=2.28-10

It is just 3 packages
libc6 libcrypt1 libgcc-s1
libc6
Depends: libcrypt1
Depends: libgcc-s1

/usr/lib/x86_64-linux-gnu/libc.so.6
/usr/lib/x86_64-linux-gnu/libc.so
/usr/lib/x86_64-linux-gnu/libc.a
MagicPoulp
 
Posts: 383
Joined: 2018-11-05 21:30

Re: how to change shared library priorities

Postby MagicPoulp » 2020-06-15 13:54

But LD_LIBRARY_PATH works for all libraries. I cannot just make a fodler with isolated libraries.

I need a sort of clone of /usr/...
but with a replacement of the 3 packages.

flutter doctor --android-licenses
I think the command above that I need will work only in a shell (no graphics) and hence can be run in a chroot.
Since the chroot does not need an x server, it should be straightforward.
MagicPoulp
 
Posts: 383
Joined: 2018-11-05 21:30

Re: how to change shared library priorities

Postby MagicPoulp » 2020-06-15 13:56

But LD_LIBRARY_PATH works for all libraries. I cannot just make a fodler with isolated libraries.

I need a sort of clone of /usr/...
but with a replacement of the 3 packages.

flutter doctor --android-licenses
I think the command above that I need will work only in a shell (no graphics) and hence can be run in a chroot.
Since the chroot does not need an x server, it should be straightforward.


So to conclude, it really seems clear that a chroot provides the cleanest approach. IF I need graphics, I can use a trick for binding an X server to the chroot.
MagicPoulp
 
Posts: 383
Joined: 2018-11-05 21:30

Re: how to change shared library priorities

Postby LE_746F6D617A7A69 » 2020-06-15 14:33

MagicPoulp wrote:So to conclude, it really seems clear that a chroot provides the cleanest approach. IF I need graphics, I can use a trick for binding an X server to the chroot.

Yes, using chroot is the safest way, but I would suggest to setup the schroot environment, which is much easier to use.
Binding to an X display is trivially easy from inside the schroot, all You need is to set/export the DISPLAY env. variable:
Code: Select all
DISPLAY=:0 path/to/application
#or
export DISPLAY=:0
path/to/application

No special tricks needed ;)
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 387
Joined: 2020-05-03 14:16

Re: how to change shared library priorities

Postby MagicPoulp » 2020-06-16 06:02

I isntalled teh android license for flutter in teh chroot, no error.
Then I copied the fgiles outside of the chroot, and the license is not valid any more.. seems like it cannot jsut be copied around.
MagicPoulp
 
Posts: 383
Joined: 2018-11-05 21:30

Re: how to change shared library priorities

Postby stevepusser » 2020-06-16 06:14

You can install openjdk-8 on Buster from the wtf repo; no need to mess around with a FrankenDebian hash of newer libc6 packages.

The rebuilt-from-wtf-source-by-yrs-truly openjdk-8 packages work fine in MX Linux, too.
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 12061
Joined: 2009-10-06 05:53

Re: how to change shared library priorities

Postby cuckooflew » 2020-06-16 07:02

Some really interesting stuff comes up in a search ,
how to change shared library priorities on Debian
2nd hit, https://www.debian.org/doc/debian-policy/ch-sharedlibs.html and there is much more available,in the results, very educational.
https://www.tecmint.com/understanding-shared-libraries-in-linux/
===========
But really , I would try the method stevepusser suggests first, if you don't like to read,study and practice.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west


Return to General Questions

Who is online

Users browsing this forum: No registered users and 18 guests

fashionable