Score:0

Install 20.04 system libraries in 21.10

ve flag

I'm facing a weird problem. I develop Qt/C++ applications. Until yesterday my dev machine and the target ones were both running Ubuntu 20.04.

Yesterday I had to upgrade my dev machine to 21.10 in order to run a specific software. Unfortunately, this has broken the compatibility of my executables:

./MyProject: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./MyProject)
./MyProject: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./MyProject)
./MyProject: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./MyProject)

I cannot:

  • upgrade the target machine
  • downgrade my dev machine
  • use a virtual machine (actually, I could, but I'm strongly trying to avoid it)

so I wonder if I can just install the system libraries of 20.04 in my 21.10 and tell QtCreator to use this or that set of libreries, like for the Qt versions.

ChanganAuto avatar
us flag
*Frankensystems* are never a good idea...
David avatar
cn flag
Not if you expect it to work. Time to use the VM.
ve flag
@David for years I used VMs but I'm tired of them... I want to use tools that run in my system... So you both are saying it's impossible to run an application for the same architecture, same distro, but just a previous/next version?
mchid avatar
bo flag
There are ways to have your application use an alternate library so that it doesn't break the system by leaving the default libs intact and simply calling the needed libraries when you run the executable. [This answer seems to be safe](https://stackoverflow.com/a/47115598/3393576). You **do not** want to replace your current glibc files and also do **not** `export` to your entire system.
mchid avatar
bo flag
You want your system to run the default glibc libs but only the executable to use the alternate libs.
Score:3
cn flag

Upgrading a single app out of band is never a good idea, especially regarding glibc.

For build tools the best way to deal with that issue is to use a Docker container.

Downgrading is an option but requires a clean install, and upgrading to 21.10 is not recommanded, as 20.04 is the actual well-supported distro and 21.10 is near EoL anyways

ve flag
Are you talking about this stuff? https://www.docker.com/resources/what-container
Nicolas Formichella avatar
cn flag
Yes @Mark, docker is one of *the way to go* for build toolchains as you can run any Ubuntu from 14.04 (not recommanded) all the way to the beta of 22.04 LTS without touching your system
ve flag
If I understand correctly this is for deployment only. I cannot debug, though.
Nicolas Formichella avatar
cn flag
Yes, exactly @Mark, it's for build toolchains
Score:1
zw flag

Targeting at interim release is impractical.
To ease workflow you have to use Long Term Support version on both development and client machines.

At present time the latest is LTS is 20.04 LTS, as you already know.

Also you can wait for April 2022 and then target both machines on 22.04 LTS. This will allow flawless usage of your application until 2027.

ve flag
That's would be the best fit for my current needs. Anyway, I learnt how Linux works the hard way.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.