Why don’t package managers have per-user installations and registries

aptdnfpackage-managementyum

Both Apt and DNF/Yum, the two most popular package management schemes for Linux distributions to my knowledge, only support system-wide installation of packages: Files owned by root, binaries go in (/usr)?/s?bin, settings go in /etc and so on.

However, on systems in which there are multiple individual users who don't have root privileges, it very often – if not always – happens that a user wants to install some apps or utilities which are available for that distribution; and s/he is fine with an installation that's personal and not common to many/all users.

Now, it does not seem a far-fetched or even incredibly complicated idea for packages to be adaptable, at installation time, with a different root directory or set of root directories, so that users can do this. Nor is it much of an issue to manage a user-specific registry of installed packages (whether or not an individual user has his/her own package DB).

So what's the reason that this functionality has not been added to those common package management systems/schemes?

Note: This is an informative question, i.e. I'm asking about what people know about the past, not what people think about this feature.

Best Answer

While common package managers don't address this use case, there are several projects that do:

My best guess as to why traditional package managers don't address this use case is that it greatly complicates the package building and installation process, since package maintainers will need to be very careful to ensure that their packages correctly support a dynamic installation directory. In fact, many common package formats such as RPM support a dynamic installation directory, but hardly any maintainers take advantage of this feature when building packages due to the high additional overhead.

Related Question