From d11686c6f0d1ef2d7c739e06ef151155b19e3469 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 8 Nov 2023 17:27:10 +0800 Subject: pkgmgt: Update the desc for "separate directories" There seems some guy overusing this method so we should add more caveats. - Use /opt/foo-x.y instead of /usr/pkg/foo-x.y. /opt/foo-x.y is used in BLFS for Rustc, Qt5, etc. and /usr/pkg is not FHS-compliant. - Use /etc/ld.so.conf and LDFLAGS instead of LD_LIBRARY_PATH. Relying on LD_LIBRARY_PATH is generally a bad idea, and we also don't use it in BLFS for /opt packages. - Discourage this method for general use, mention it may not work for vital packages like Glibc. --- chapter08/pkgmgt.xml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/chapter08/pkgmgt.xml b/chapter08/pkgmgt.xml index 794fe1259..185538796 100644 --- a/chapter08/pkgmgt.xml +++ b/chapter08/pkgmgt.xml @@ -196,19 +196,29 @@ This is a simplistic package management technique that does not need a special program to manage the packages. Each package is installed in a separate directory. For example, package foo-1.1 is installed in - /usr/pkg/foo-1.1 - and a symlink is made from /usr/pkg/foo to - /usr/pkg/foo-1.1. When + /opt/foo-1.1 + and a symlink is made from /opt/foo to + /opt/foo-1.1. When a new version foo-1.2 comes along, it is installed in - /usr/pkg/foo-1.2 and the previous + /opt/foo-1.2 and the previous symlink is replaced by a symlink to the new version. Environment variables such as PATH, - LD_LIBRARY_PATH, MANPATH, - INFOPATH and CPPFLAGS need to be expanded to - include /usr/pkg/foo. If you install more than a few packages, - this scheme becomes unmanageable. + MANPATH, INFOPATH, + PKG_CONFIG_PATH, CPPFLAGS, + LDFLAGS, and the configuration file + /etc/ld.so.conf may need to be expanded to + include the corresponding subdirectories in + /opt/foo-x.y. + + This scheme is used by the BLFS book to install some very large + packages to make it easier to upgrade them. If you install more + than a few packages, this scheme becomes unmanageable. And some + packages (for example Linux API headers and Glibc) may not work well + with this scheme. + Never use this scheme system-wide. + -- cgit v1.2.3-54-g00ecf