3

I know it's necessary to run revdep-rebuild after upgrades of my Gentoo Linux. I also kind-of understand that revdep-rebuild detects shared libraries conflicts and fixes them somehow. But I want to understand more.

If (hypothetically) I decide to do revdep-rebuild's job manually, how would I do it? How would I select all the binaries to test? How would I check if some particular binary is ok? If there is some problem with a binary - how would I know what package to re-emerge in order to fix it?

  • 2
    Looking at the source code of revdep-rebuild is presumably an option. – Faheem Mitha Jan 30 '15 at 8:56
  • 2
    Looking at the source code is the last resort! – lesnik Jan 30 '15 at 9:40
3
  1. First, you may find all executables.
  2. Then use ldd to find *.so dependencies.
  3. After that, if some shared object doesn't exist, use qfile to detect ebuild containing it.
  4. Finally, re-emerge all packages detected to be broken.
1

Please read the Reasoning Section in Using Awesome window manager on CentOS 7. Whether or not the distribution is binary or not is irrelevant. This is because the same behavior can occur in all distributions.

Items 4 - 6 in the linked post are what revdep-rebuld fixes. The fancy name for Item 4 is a Reverse Dependency. The only definition I could find was in this Wikipedia entry for Dependency Hell. See Conflicting and Circular Dependencies.

revdep-rebuld, short for reverse dependency rebuild works by scanning your /lib directories for .so objects, then compares the version of the Shared Object to the version of the Static Library - the .a files, if the static-libsUSE Flag was used. Both of these are then compared to the output of ldd If there is a mismatch, the package is marked for rebuild, and then rebuilt.


All of that is in webKnjaz's answer, except revdep-rebuild always starts at his step 2, i.e. it always assumes all packages are broken, therefore it assumes all libraries are broken until scanned.

You should also know that revdep-rebuild has been integrated into newer versions of sys-apps/portage in the @preserved-rebuild set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.