LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-22-2010, 01:47 AM   #1
ksp009
LQ Newbie
 
Registered: Dec 2010
Posts: 19

Rep: Reputation: 0
RPM installation


Hi

I am using RHEL6 as host. I need to install toolchain packages(rpms) in host. So i downloaded binutils.2.20.51 rpm from redhat site.
and i did
rpm -ivh <name of rpm>, it gets installed in the default location. But i need to install it in the /opt, so i used
rpm -ivh --prefix=/opt <name of rpm>. But it returns "rpm package is not relocatable"

How can i install rpm packages in a particular dirctory?

Thanks
 
Old 12-22-2010, 01:50 AM   #2
aby
LQ Newbie
 
Registered: Dec 2010
Location: mumbai
Distribution: Red Hat LInux 5.0
Posts: 24

Rep: Reputation: 0
rpm

hi kps009

it is simple copy your rpm package to your desire directory & go to that directory from the terminal type your rpm command of rpm -ivh XXXXX
 
0 members found this post helpful.
Old 12-22-2010, 02:08 AM   #3
prodev05
Member
 
Registered: Jul 2009
Location: Planet Earth
Distribution: Unix & Linux Variants
Posts: 304

Rep: Reputation: 20
ksp009

while building the rpm, there is a SPEC which is instructed to extract the binaries and configuration(text files) in the specific directory. Here /opt is excluded. Only third party packages/bundles could be installed in /opt file system.

Other wise you can extract the rpm in the /opt file system and create a soft/hard link for the binaries. Again this is an R&D.

Before trying to install the rpm. Do a pre-check whether that rpm can install with out any error by the below command.

"rpm -ivh --test abcd.x.x.x.rpm" // This will do a pre-check on the rpm installation. later you can remove "--test" and start installation.


regards
++Arun
 
Old 12-22-2010, 02:08 AM   #4
ksp009
LQ Newbie
 
Registered: Dec 2010
Posts: 19

Original Poster
Rep: Reputation: 0
hi aby

I copied it in the /opt and followed the command. But it again gets installed in the default directory.


Thanks
 
Old 12-22-2010, 02:38 AM   #5
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,274

Rep: Reputation: 148Reputation: 148
I dont think its possible to install rpm package in desired location because it will install in default path. if you wish to install a package in specific location then try with source tarball
 
Old 12-22-2010, 03:58 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,986

Rep: Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447
Quote:
How can i install rpm packages in a particular dirctory?
you DO NOT .
you can rebuild a rpm to install in a different directory using the rpms ( source rpm)

BUT YOU should not just install some random package
use "yum" to install packages form the red hat network repo ( RHN)
you did read the red hat documents like the "user guide"

https://access.redhat.com/knowledge/...erprise_Linux/

Quote:
So i downloaded binutils.2.20.51 rpm
please DO NOT do things that way you WILL kill the install .
use "yum" to install the tool chain
Code:
su -
yum groupinstall" Development Tools"
see the man and help page
Code:
yum --help
man yum
 
Old 12-22-2010, 09:36 AM   #7
jwl17330536
Member
 
Registered: Feb 2010
Location: Raleigh, NC
Posts: 83

Rep: Reputation: 22
Quote:
Originally Posted by aby View Post
hi kps009

it is simple copy your rpm package to your desire directory & go to that directory from the terminal type your rpm command of rpm -ivh XXXXX

That is just bad advice and will not work.
 
Old 12-22-2010, 12:56 PM   #8
packets
Member
 
Registered: Oct 2005
Posts: 310

Rep: Reputation: 30
Why not install it via source http://ftp.gnu.org/gnu/binutils/ and upon compilation, prefix it to /opt though your title says you want to use rpm
 
Old 12-22-2010, 01:42 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Actually an RPM can have relocatable paths but only if it was built using the "Prefix" macro. If it was then using "--prefix=/opt" means the OP never read 'man rpm' as it clearly states using --relocate /old/path=/new/path.
 
Old 12-22-2010, 01:44 PM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Quote:
Originally Posted by packets View Post
Why not install it via source
...about bad advice: this is a similarly bad idea.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RPM installation vinaytp Linux - Newbie 5 03-12-2010 09:33 AM
rpm -ihv hp_qla2x00src-8.01.07.25-1.linux.rpm during Qlogic driver installation Dennisliu Linux - Software 5 09-10-2008 06:08 PM
Hosed my rpm installation (i.e. "rpm -e rpm") Mad Scientist Fedora 6 03-02-2007 01:42 AM
RPM Re-installation Cottsay Linux - Software 7 03-07-2006 05:58 PM
RPM installation RedDevils Fedora 8 12-24-2003 10:07 AM


All times are GMT -5. The time now is 08:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration