mathworks / build-glibc-bz-19329-patch

This repository provides a Dockerfile and build instructions to apply patch BZ-19329 to glibc
20 stars 6 forks source link

Problem Using `apt` After Installing Patch - Fix #9

Closed benxro closed 1 year ago

benxro commented 1 year ago

We had the same issue as detailed in Problem Using apt After Installing Patch for systems running on Debian 11. E.g. when trying to install some package, for example libvtk7-dev, we got the error

The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.31-13+deb11u5) but 2.31-13+deb11u5.debian.bullseye.custom is to be installed
E: Unable to correct problems, you have held broken packages.

Other attempts with apt-get -f install didn't fix the issue either. Since we are managing several computers in our network, installing a newer distribution wasn't an option. When we used the PKG_EXT='' flag, we ended up with version 2.31-13+deb11u5., resulting in the same error.

But if you go to /scripts/setup-glibc-build-env-vars.sh, and change line 11 from: PKGVER=$(dpkg-query --showformat='${Version}' --show libc6).${PKG_EXT-${DIST_BASE}.${DIST}.custom} to PKGVER=$(dpkg-query --showformat='${Version}' --show libc6), you can remove the version name extension of the packages that you build. Hence, we can build a package called libc6_2.31-13+deb11u5_amd64.deb and install it with dpkg -i libc6_2.31-13+deb11u5_amd64.deb. Now, when you run dpkg-query --show libc6, it will return libc6:amd64 2.31-13+deb11u5, which is the same "version" as before but now with the patch. This solved our dependency conflicts.

Note: This is a somewhat dirty fix. You're basically fooling your system into thinking that it has the regular (unpatched) version installed, which is not the case. There is no possibility anymore to check if you actually have the patched libc6 version installed or the regular one. This could lead to further issues, however it solved our problems and works for now.

josmartin commented 1 year ago

@benxro As the other issue points out - what you should do is ALSO install the libc6-dev from the release area of this repo. If newer packages that you install need something that would have been provided by this repo then you need to manually install it from this repo. I would not recommend the name change approach you point to above - I agree it does work since the names are how apt decides if things are the same or not ... but there may be incompatibilities in build between the core repos and the ones built here.