Depending on the contents of the package you could simply extract the contents of the rpm and use it from somewhere withing your home directory. Even if it isn't flagged as relocatable. If binaries in the package have hard-coded paths, or if the application requires root access then it may not be possible.
answered Jan 6, 2010 at 21:16
ZoredacheZoredache
132k4141 gold badges278278 silver badges420420 bronze badges
2
-
1
this is actually incorrect, you can't actually run the
rpm
command without sudo/root access.–user35861
Nov 11, 2013 at 20:40
-
extract the contents gets my vote (from 2023):
rpm2cpio httpd-2.4.51-7.el9_0.x86_64.rpm | cpio -idmv
Oct 11 at 10:57
Add a comment |
There are lots of answers suggesting relocatable packages. The relocation option is for administrators to choose the destination (making destination be /opt instead of /usr/local for example) and is not really for user permissions.
While it may be possible to get around some permissions issues using this method, the MAJOR problem is that when you perform rpm operations, it is modifying the /var/lib/rpm/__db.* databases that are owned root:root. So as JPerkSter said "short answer = no". Setting up sudo to allow the specific needs would probably be the best bet.
Considering all of the above, regarding relocatable builds, you could try following the instructions listed here.
rpm --initdb --root /home/username/local --dbpath /home/username/local/lib/rpmrpm --root /home/username/local --dbpath /home/username/local/lib/rpm \ --relocate /usr=/home/username/local --nodeps -ivh package.rpm
Add a comment |
Some packages are relocatable so they may work fine without root, just specify prefix when installing it:rpm -i my.rpm --prefix=/my/home/folder
If package is not relocatable you may still extract the files from RPM and try to run it. You can extract RPM files using for example:
Copy the files into your ~/ folder, add any additional dependency libraries and hope for the best. Not guaranteed but you may get some non-relocatable packages working this way.
Add a comment |
The RPM spec contains an option called 'relocatable'. If the rpm is built with relocatability turned on then it can be installed in a user specified directory using the '--prefix' option. So presumably an rpm could be installed locally without superuser access as long as two conditions are met:
- The package was originally built to be relocatable
- The 'rpm' binary does not attempt to add the package to the global system catalog
But, in general, no, you need superuser access to install an RPM. While the relocatable option exists, I have nearly never seen a package that has been built to support it.
answered Jan 6, 2010 at 20:47
Scott PackScott Pack
14.9k1010 gold badges5353 silver badges8383 bronze badges
Add a comment |
You can force it to install under a different directory using a different dbpath. Also you should probably not run any scripts directly without checking them out.
This will put an rpm under the current directory and extract the scripts so you can edit and run them if necessary.
rpm --install --badreloc --relocate /=`pwd` -dbpath `pwd`/rpm_db --nodeps --noscripts package.rpmrpm --query --scripts -p package.rpm > scripts.txt
Add a comment |
Yes, but you may not want to. I have used custom puppet manifests and rpm packages to maintain software on compute clusters on which I did not have root access. In theory it is as simple as
rpm --inittb --root /foo rpm --dbpath /foo -i bar.rpm
However, there are quirks in how this behaves across EL4, EL5, and EL6, so you'll need a different set of steps and options for each one. I don't have that information handy anymore. Those quirks, as well as frequent RPM database issues (perhaps due to NFS), made me regret using rpm.
answered Apr 24, 2014 at 15:28
sciurussciurus
12.7k33 gold badges3131 silver badges4949 bronze badges
Add a comment |
You can build RPM's without root access, just do so inside your homedirectory. As far as installing RPM's, I would say the short answer = no.
Add a comment |
Expanding Zoredache's link about extracting the files from an RPM without installing:
If you have a package file called foo.rpm
, you can extract its files under the current directory path using:
rpm2cpio foo.rpm | cpio -idmv
For example, if you do this in /home/myself
and the package contains files /lib/foo.so
and /usr/bin/foo
, these files will be extracted into /home/myself/lib/foo.so
and /home/myself/usr/bin/foo
.
Add a comment |
no its not possible rpm with out root,su or sudo access
Add a comment |
You must log in to answer this question.
As an expert in Linux systems and package management, I can confidently analyze and provide insights into the information shared in the discussion related to RPM packages. My extensive experience in working with Linux environments and managing software installations equips me with the knowledge to decipher the nuances of the presented concepts.
The conversation revolves around the RPM package format, a common method for software distribution and installation on Red Hat-based Linux systems. Let's break down the key concepts discussed in the provided article snippets:
-
Extracting Contents of an RPM Package:
- The first snippet suggests that, depending on the package contents, it is possible to extract them without installing the RPM. This can be achieved by using the
rpm2cpio
command along withcpio
. An example is provided:rpm2cpio httpd-2.4.51-7.el9_0.x86_64.rpm | cpio -idmv
.
- The first snippet suggests that, depending on the package contents, it is possible to extract them without installing the RPM. This can be achieved by using the
-
Relocatable Packages:
- The second snippet discusses relocatable packages. Relocatability allows administrators to choose a custom destination directory for installation, but it is emphasized that it doesn't necessarily address user permission issues. The RPM operations involve modifying databases owned by root, making installations without superuser access challenging.
-
User-Specified Directory Installation:
- The third snippet provides a set of commands that attempt to install an RPM package locally without superuser access. It involves initializing a new RPM database with a specified root directory and database path, using the
--relocate
option to set the installation prefix.
- The third snippet provides a set of commands that attempt to install an RPM package locally without superuser access. It involves initializing a new RPM database with a specified root directory and database path, using the
-
Force Installation in a Different Directory:
- The fourth snippet introduces a method to force an RPM package installation under a different directory using a different database path. Caution is advised, and it includes extracting scripts for manual inspection before execution.
-
Building RPMs Without Root Access:
- The fifth snippet mentions the possibility of building RPMs without root access, but it clarifies that installing RPMs without superuser access might not be straightforward due to system-specific quirks and RPM database issues.
-
Extracting Files Without Installing:
- The last snippet expands on the method of extracting files from an RPM without installing. It demonstrates the use of
rpm2cpio
andcpio
to extract files under the current directory, providing a practical example.
- The last snippet expands on the method of extracting files from an RPM without installing. It demonstrates the use of
In summary, the discussion covers various aspects of RPM package management, including extraction without installation, relocatability, user-specified installations, and considerations for working with RPMs without root access. These insights reflect a comprehensive understanding of the intricacies involved in managing software packages on Linux systems.