Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I install an RPM on a machine where I don't have root permissions? I want to install a package for my use only in a personal work directory. I'm running SuSe SLES10.

Please don't flame me with "This idea is so dumb, you shouldn't do it because all requests must go through the corporate root god, may he live forever."

I know I can request this of the root god, but I'll be shot down (for immaculate, impeccable reasons, I'm sure...). Besides, he'll never get around to installing it even if he does say he'll do it.

share|improve this question
This isn't a duplicate at all. Overriding the path does not always allow a non-priviledged user to utilize rpm. – John T Nov 11 '10 at 19:08
Thanks HarryMC. I'll check that out. Also, adding link to the other ticket that people thought mine was a duplicate of. Maybe the breadcrumbs will help someone else : – Ross Rogers Nov 11 '10 at 22:47
up vote 18 down vote accepted
cd my-dir;
rpm2cpio to-install.rpm | cpio -idv

See How To Extract an RPM Package Without Installing It (rpm extract command).

share|improve this answer
I did this and cpio doesn't seem to do anything except print '1 block'. Did I do something wrong? – Nate Parsons Nov 16 '10 at 15:44
Thanks. Turns out I was able to install from source, so I don't need to bother with RPMs – Nate Parsons Nov 16 '10 at 16:11
That just unpacks the contents of the RPM and dumps it where you are. That doesn't mean the result works (its configuration isn't where it should be, ...) – vonbrand Jan 18 '13 at 17:07

Another option is to install from source, where you can usually change the install directory using the --prefix switch.

share|improve this answer
That's what I normally do, but I was hoping for some more automation. – Ross Rogers Feb 10 '11 at 19:11

How to extract rpm packages contents

export ins=foo-bar.rpm
rpm2cpio $ins | cpio -idv

How to extract tar.gz archive

gzip -dc foo-bar.tar.gz | tar xvf –
cd foo-bar-dir

How to extract tar.gz packages to the current directory

export file=foo-bar.tar.gz
# Note that `xovf` switch order *matters*
gzip -dc $file | tar -xovf -

How to build binaries as a non-root

./configure --prefix=$HOME && make && make install
share|improve this answer

You must log in to answer this question.

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