Package-Management – Non-Root Package Managers

not-root-userpackage-managementrootyum

From my research, I seem to notice that all package managers insist on being used as a privileged user and must be installed into /.

Typically, what I like to do is create a throwaway account, compile some software, and install to $HOME for that account. I can try a variety of setups and then when I'm done, just destroy the account.

However, compiling software becomes tedious.

My experience is really just limited to yum, but I don't understand why I wouldn't be able to drop a repo file into ~/etc/yum.repos.d and have yum install everything into a home account.

Is there any reason why package managers must be used as a privleged user to install software?

Best Answer

Binary packages are compiled with the assumption that they will be installed to specific locations in /. This is not always easily changed, and it would take additional QA effort (which is difficult enough in the first place!) to determine whether specific binaries are or aren't relocatable.

To an extent, you can use things like fakechroot to create an entire system in a subdirectory as a non-root user, but this is tedious and fragile.

You will have better luck with source packages. Gentoo Prefix and Rootless GoboLinux are both package managers that can install to non-/ locations and may be usable by non-root users.

Related Question