[SOLVED] UPGRADEPKG doesn't overwrite and replace old libraries and links?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
UPGRADEPKG doesn't overwrite and replace old libraries and links?
Recently downgraded Glibc to a previous version with upgradepkg --reinstall and had a lot of libraries and links from the removed package left intact (in /lib64/). Ended up getting errors from coreutils, file, and other common programs that use glibc (GLIBC_2.XX not found). Was able to fix by booting from slackware dvd and manually removing the old ld-2.xx.so files and fixing the broken links by hand (very time consuming). Errors and problems went away.
Apparently upgradepkg didn't completely remove the package and replace it with the one I chose to install. Why is that?
I'm bothered by this encounter since I normally bootstrap my system when doing a major software change (like changing glibc version and/or kernel-headers). Basically I recompile and re-install every package in 3 passes.
Was this an unlucky encounter due to the fact Glibc is pretty much the most critical dependency and upgradepkg is overly sensitive to this particular package? Or does upgradepkg not overwrite previous files even if they're the same? If they're different files that belong to the removed package, why were they not removed and links replaced-updated?
Have I been bootstrapping my system in vain with upgradepkg, always having old links and libraries left intact with all other packages?
Glibc is a hard and locked dependency in GNU/Linux and usually it's only upgraded through a major near-to-full distribution rebuild against it. Even a small update in glibc can break many packages. When glibc-2.18 was released, many existing packages that worked fine with glibc-2.17 required various sed edits and patch files, and still do to some extent to build against 2.18. I don't think Patrick has upgraded to 2.18 either due to the amount of edits, patches, and rebuilds required against it.
When I've seen Slackware update glibc in the past, it's usually accompanied by a huge update of various core system packages, a new Linux kernel, glibc-kernel-headers, and any other packages found to be broken against the new glibc.
As Eric pointed out, unless you absolutely know what you're doing, never touch glibc or the glibc-kernel-headers... Ever. And downgrading any core system package in a GNU/Linux distribution is never recommended.
Also the glibc package is designed to not uninstall as it drops the libs in a different directory and then moves them into place, pkgtools simply does not handle those file moves so the package can not be removed.
Even the LFS books state very clearly, you can roughly update about everything in LFS minus glibc. If you upgrade glibc it's best to just rebuild LFS, or you'll have issues. If that book says no, on any other distribution it means the same thing.
Also the glibc package is designed to not uninstall as it drops the libs in a different directory and then moves them into place, pkgtools simply does not handle those file moves so the package can not be removed.
Okay, so what happens if I don't change glibc versions but re-install it after compiling? Will it replace all the libraries with the ones I recompiled?
What about other library packages; if there's a version update to Glib2, will the old libraries and links be replaced with new ones, or will upgradepkg just ignore them all and install the new ones on the side?
Appreciate the responses.
EDIT:
Compared date of /var/log/packages/packagename with package library file and they match. So old libraries do get replaced when re-installing the same package. The links however, did not get re-created it seems (date was from older package date) though they point to the same file anyway (the actual file is different which is what matters).
I'm going to run a script maybe, from another forum member (grapefruitgirl). It checks for broken links and files that don't belong to any installed package. Think this would be useful for custom Slackware setups; also because upgradepkg doesn't seem to re-create links.
So as everyone pretty much told me, upgradepkg doesn't handle glibc downgrades without borking the system...
Glibc is the most critical library for anything to function (kind of how the kernel is important). Should've known that before blaming upgradepkg. Stupid me!
Ordinarily, upgradepkg will overwrite any existing items even if they are the same. But, if you really used this syntax:
"downgraded Glibc to a previous version with upgradepkg --reinstall"
'reinstall' will do nothing unless the version is the same.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.