Preserve-libs

preserve-libs is Portage feature]] that preserves libraries when sonames change during upgrade or downgrade, only as necessary to satisfy shared library dependencies of installed consumers. Preserved libraries are automatically removed when there are no remaining consumers, which occurs when consumer packages are rebuilt or uninstalled. Ideally, rebuilds are triggered automatically during updates, in order to satisfy slot-operator dependencies. Before exits after installing updates, if there are remaining preserved libraries because slot-operator dependencies have not been used to trigger automatic rebuilds, then  will display a message like the following:

In some cases, preserved libraries may remain even after the user has rebuilt the relevant package(s). In cases like these, repeated invocations of will not eliminate the preserved libraries. This indicates that the build system for a particular package causes it to inappropriately link against the old (preserved) version of the library, instead of the new one. If you find a package like this, then you should file a bug for the package maintainer (for example, see ). As a workaround, you can manually remove the old library (such as ) and then run in order to rebuild the packages which linked against it. A list of all preserved libraries may be obtained using:

If preserve-libs is not enabled in FEATURES, then users need to manually run in order detect broken library dependencies and rebuild the appropriate packages.

Note that libraries preserved by preserve-libs (or alternatively by the  function of preserve-libs.eclass) prevent breakage that would otherwise be detectable by. Therefore (without special arguments) is not useful for rebuilding consumers of preserved libraries. Instead, if preserve-libs is enabled, then will advise the user to run  when necessary. Alternatively, if preserve-libs is not enabled and the  function from preserve-libs.eclass has been called by an ebuild in order to preserve a library, then the user will receive an ewarn message like the following: