Local installation of package in Red Hat / Fedora Linux

Login or Register to Reply

Thread Tools Search this Thread
# 1  
Old 01-18-2018
Tools Local installation of package in Red Hat / Fedora Linux

Hi all,

I have a requirement to install rpm package(*noarch.rpm) in local to a directory, ex /tmp/mydir.

which steps I need to follow to install rpm package local to the directory only, not to the default directories.

Please share me the link if the topic is already discussed. I tried few forums, couldnt get right direction.

# 2  
Old 01-19-2018

Firstly, not all RPM packages support re-location. The package maintainer has to have designed the package to permit this. Typically many do not, since the software in the package has been compiled with a particular installation path in mind. But if your package is re-locatable this should be fairly simple, and doable with a command like:

rpm --prefix=/path/to/new/root/ -ivh package.rpm

This would install the package package.rpm underneath the directory /path/to/new/root/, as opposed to underneath / as normal.

If your package is not re-locatable, then you could always just convert the RPM to a cpio archive and manually extract it. Create a directory to extract the contents in, move your RPM in there, and do something like:

rpm2cpio package.rpm | cpio -div

This would extract the cpio archive inside the RPM underneath the current working directory. Note that of course this is just going to extract the software and you will ultimately have hte same problem - if the package is not meant to be re-located to somewhere else, it's not going to work in a new location.

If you absolutely need to re-locate a package that's not re-locatable, then you could always download its source code and configure it with your desired installation prefix, and compile and install it there.

Hope this helps.
# 3  
Old 01-19-2018
I tried rpm2cpio package.rpm | cpio -div and corresponding files got created. I am planning to install erlang, planning to figure out where to take from here. what command I should run against bin.

Last edited by rbatte1; 01-19-2018 at 01:13 PM.. Reason: Wrapped command in ICODE tags
# 4  
Old 01-19-2018

I'm not 100% sure what you mean, sorry. The package will have had its files extracted underneath wherever you ran the cpio command. You might be able to just run /path/to/wherever/bin/whatever and it might just work, but equally it may not. As I mentioned previously, many packages are not designed to be re-locatable, and might misbehave or fail in unexpected ways as a result of not having their binaries, libraries and other support files in the locations they expect to find them. I'm not myself familiar with Erlang at all, so can't really give any package-specific advice here.

If it comes to it, then as I say you can always download the source of the package (assuming it has source code available, almost all packages do generally speaking) and compile it yourself, specifying exactly the directory you want to install the resulting binaries in. You don't normally have to be root or need to have sudo access to compile most things, if user permissions and access rights are ultimately your real problem here.
Login or Register to Reply

Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Which is the better platform to learn UNIX/Linux (Kali Linux Vs. Red Hat or other)? ApacheOmega Fedora 12 01-12-2015 01:33 PM
Red Hat 6 yum install no package availiable ainstin Red Hat 2 08-28-2014 10:45 AM
how to know if i use "Red Hat Enterprise Linux" or "Red Hat Desktop" ? ahmedamer12 UNIX for Dummies Questions & Answers 2 05-18-2012 12:02 PM
Does Red hat linux 9 has audit rpm package? nnnnnnine Red Hat 0 02-07-2012 04:33 AM
Fedora or Red Hat Man Pages cokedude Red Hat 4 08-08-2011 10:30 AM
download package for red hat linux 5 chuikingman Red Hat 9 06-04-2011 11:14 PM
Installation of Red Hat enterprise edition? infovenu231 Red Hat 1 12-09-2009 02:51 AM
Does Red Hat Fedora support Nvidia card 8800GTX and 260 card? sito UNIX Desktop Questions & Answers 1 12-10-2008 06:20 AM
The Red Hat Cluster Manager Installation and merlin Red Hat 0 05-01-2007 12:27 PM
Red Hat Linux 9 Jawwad Linux 5 11-06-2005 12:23 PM
Problem Red Hat 9 Installation vedder191 UNIX for Dummies Questions & Answers 2 09-15-2005 07:55 PM
Installation Problem on Red hat linux 9 kayode Linux 4 01-12-2004 09:28 AM
red hat linux installation boot floppy disk linuxpenguin UNIX for Dummies Questions & Answers 3 11-28-2003 02:10 PM
XP to Linux (Red Hat) lawadm1 UNIX for Dummies Questions & Answers 3 10-29-2003 11:16 PM
Red Hat Linux 6.0 bbutler3295 UNIX for Dummies Questions & Answers 2 03-02-2002 10:50 AM