On Red Hat how to install a package as a non-root user?
May 10, 4:02pm
On Red Hat-based systems (like RHEL, CentOS, or Fedora), you can install packages as a non-root user in a few ways, depending on your permissions and the package format. Here are the most common methods:
1. Using dnf or yum with --user (for RPM packages)
If you have sudo privileges, you can install RPM packages system-wide, but if you want to install packages only for your user, you can use:
bash
dnf install --user <package-name>
or
bash
yum install --user <package-name>
This installs the package in your user's ~/.local directory.
2. Using pip (for Python packages)
If the package is a Python package, you can install it locally for your user with:
bash
pip install --user <package-name>
This installs the package in ~/.local/lib/pythonX.Y/site-packages/.