rpm without root (2024)

10 Answers

4

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

rpm without root (1)

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

    bownie

    Oct 11 at 10:57

Add a comment |

8

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.

answered Jan 6, 2010 at 21:57

rpm without root (2)

AlexAlex

6,61311 gold badge2424 silver badges3232 bronze badges

6

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

answered Feb 6, 2014 at 8:26

rpm without root (3)

Lee GoddardLee Goddard

19122 silver badges99 bronze badges

Add a comment |

4

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.

answered Oct 26, 2012 at 16:35

rpm without root (4)

DatageekDatageek

16155 bronze badges

Add a comment |

3

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:

  1. The package was originally built to be relocatable
  2. 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

rpm without root (5)

Scott PackScott Pack

14.9k1010 gold badges5353 silver badges8383 bronze badges

Add a comment |

2

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

answered Apr 24, 2014 at 13:31

rpm without root (6)

user12722user12722

2122 bronze badges

Add a comment |

2

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

rpm without root (7)

sciurussciurus

12.7k33 gold badges3131 silver badges4949 bronze badges

Add a comment |

1

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.

answered Jan 6, 2010 at 20:24

rpm without root (8)

JPerkSterJPerkSter

28533 silver badges1313 bronze badges

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.

answered Jan 13, 2021 at 23:49

rpm without root (9)

krubokrubo

21111 silver badge33 bronze badges

Add a comment |

-2

no its not possible rpm with out root,su or sudo access

answered Jan 6, 2010 at 20:35

rpm without root (10)

RajatRajat

3,3492222 silver badges2929 bronze badges

Add a comment |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged

.

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:

  1. 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 with cpio. An example is provided: rpm2cpio httpd-2.4.51-7.el9_0.x86_64.rpm | cpio -idmv.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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 and cpio to extract files under the current directory, providing a practical example.

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.

rpm without root (2024)

FAQs

How can I see RPM contents without installing? ›

Firstly, we learned that we can use the rpm command to list the contents of an installed package. Then, we examined the yum repoquery, repoquery and dnf repoquery commands. We saw that we can use the -l option of these commands to list the contents of an installed or non-installed package in the repository.

How do I force install RPM without dependencies? ›

If you want to forcefully install an RPM package without dependencies, use this command: sudo rpm -i –nodeps <file. rpm>. Does RPM contain dependencies? Yes, dependencies are packages that an RPM requires to function properly.

How do I extract RPM? ›

First, let's understand each command separately.
  1. 2.1. The cpio Command. cpio is a tool for copying files to or from an archive file. ...
  2. 2.2. The rpm2cpio Command. rpm2cpio extracts the cpio archive within an RPM package. ...
  3. 2.3. Using cpio and rpm2cpio Together.
Mar 18, 2024

How to install RPM using command? ›

Standard RPM installation
  1. Open a terminal and navigate to the location of the . rpm file.
  2. Execute the following command with superuser permissions: rpm -i filename .rpm. This installs the product to the following default location - /opt/microfocus/VisualCOBOL.

How do I manually download an RPM package? ›

Use RPM in Linux to install software
  1. Log in as root , or use the su command to change to the root user at the workstation on which you want to install the software.
  2. Download the package you wish to install. ...
  3. To install the package, enter the following command at the prompt: rpm -i DeathStar0_42b.rpm.
Jul 12, 2023

How to install rpm in local directory? ›

How to install RPM local package with yum? To install a local package in any Red Hat-based Linux system like RHEL, Fedora, and CentOS at first move to the download folder using cd Download/ then run sudo yum localinstall filename. rpm or you can just run sudo yum localinstall path/filename. rpm in the terminal.

How do I see all installed RPMs? ›

On a running system, use the rpm command to get a listing of packages installed via rpm.
  1. # rpm -qa. <Content to be added>
  2. # yum list installed. </Content to be added>
  3. installed-rpms. var/log/rpmpkgs.

How to install rpm from repository? ›

Install, update, or remove RPMs as follows:
  1. To install an RPM from the yum repository, run the following command: # yum install rpm_name.
  2. To update a specific RPM, run the following command: # yum update rpm_name.
  3. To update all the RPMs, run the following command: # yum update.

What can I use instead of RPM package? ›

RPM Package Manager AlternativesPackage Managers & Software Installers like RPM Package Manager
  • 294. Chocolatey. Software Installer. ...
  • 152. Homebrew. ...
  • 167. Synaptic. ...
  • Warehouse. Package Manager. ...
  • pacman (package manager) Package Manager. ...
  • npm. Package Manager. ...
  • Nix Package Manager. Package Manager. ...
  • Advanced Package Tool. Package Manager.
Oct 11, 2023

How to extract rpm file in Linux without installing? ›

The rpm2cpio command will output (to stdout) a cpio archive from the RPM package. To extract the package files we'll use the output from rpm2cpio and then use the cpio command to extract and create the files we need. The cpio command copies files to and from archives.

How to remove rpm without dependencies? ›

Removing RPM Packages Forcefully

-e or –erase – removes the package. –allmatches – removes all versions of packages that match the PACKAGE_NAME. –nodeps – prevents dependency checks.

What is the command to make RPM? ›

The rpmbuild command is used to build RPM packages. The syntax for rpmbuild is: rpmbuild -[b|t] stage [ build-options ] spec-file ... Specify -b to build a package directly from a spec file, or -t to open a tarred, gzipped file and use its spec file.

What opens RPM files? ›

An RPM file is a Red Hat package manager file. Open one on Linux with RPM Package Manager, or on Windows with 7-Zip.

How to install RPM from repository? ›

Install, update, or remove RPMs as follows:
  1. To install an RPM from the yum repository, run the following command: # yum install rpm_name.
  2. To update a specific RPM, run the following command: # yum update rpm_name.
  3. To update all the RPMs, run the following command: # yum update.

How to install RPM with its dependencies? ›

To download any rpm file with all dependencies, you have to use yum with the syntax: sudo yum install <package-name>. It will automatically resolve all dependencies.

How to install RPM using DNF? ›

To install a local package in any Red Hat-based Linux system using dnf, first move to the download folder using cd Download/ then run sudo dnf install filename. rpm or you can just run sudo dnf install path/filename. rpm in the terminal. It will install the local package in your system using the DNF package manager.

How do I know where my RPM is installed? ›

On a running system, use the rpm command to get a listing of packages installed via rpm.
  1. # rpm -qa. <Content to be added> Using yum can report similar information.
  2. # yum list installed. </Content to be added> The same data can be obtained from a sosreport.
  3. installed-rpms. var/log/rpmpkgs.

Top Articles
Latest Posts
Article information

Author: Kerri Lueilwitz

Last Updated:

Views: 5569

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Kerri Lueilwitz

Birthday: 1992-10-31

Address: Suite 878 3699 Chantelle Roads, Colebury, NC 68599

Phone: +6111989609516

Job: Chief Farming Manager

Hobby: Mycology, Stone skipping, Dowsing, Whittling, Taxidermy, Sand art, Roller skating

Introduction: My name is Kerri Lueilwitz, I am a courageous, gentle, quaint, thankful, outstanding, brave, vast person who loves writing and wants to share my knowledge and understanding with you.