LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 01-26-2011, 01:50 PM   #1
g_paschoal
Member
 
Registered: Oct 2009
Posts: 131

Rep: Reputation: 15
RPM question


Hi Guys.

If I have a RPM package. This package contain a lot of files and scripts on it. It is possible for me to execute just one script or extract just one file from that RPM file ? Without having to extract the whole package ?

Thanks in advance
 
Old 01-26-2011, 01:51 PM   #2
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 266

Rep: Reputation: 19
Quote:
Originally Posted by g_paschoal View Post
Hi Guys.

If I have a RPM package. This package contain a lot of files and scripts on it. It is possible for me to execute just one script or extract just one file from that RPM file ? Without having to extract the whole package ?

Thanks in advance
http://www.cyberciti.biz/tips/tag/ex...files-from-rpm
 
Old 01-26-2011, 02:02 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
You can open the rpm package with the 'Midnight Commander'.
The package name is mc, and the command is 'mc'.

Then you can copy any file from CONTENTS.cpio, using <F5>

..
 
Old 01-26-2011, 02:11 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Another alternative is to just grab the source RPM if available, install it, go grab the files and scripts you want from it.
 
Old 01-27-2011, 01:28 AM   #5
prodev05
Member
 
Registered: Jul 2009
Location: Planet Earth
Distribution: Unix & Linux Variants
Posts: 304

Rep: Reputation: 20
Try this.

"rpm2cpio abcd.x.y.z.rpm | cpio --extract --make-directories " // This will extract the whole rpm
 
Old 01-27-2011, 05:05 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
OK, this thread is not really about extracting the whole package,
but about plugging out one file.

But for the sake of completeness :
A more convenient command for the complete package :
rpm2cpio <package.rpm> | cpio -idmv

Or, if you want to create a new directory for the content, with the package name :
( The script was created by @unSpawn )

sh unPack_rpm.sh <package.rpm>
.
Attached Files
File Type: txt unPack_rpm.sh.txt (593 Bytes, 18 views)
 
  


Reply



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 question mokku Linux - Newbie 4 06-10-2008 01:59 PM
question about rpm rockwell_001 Linux - General 3 04-13-2005 04:22 PM
rpm question tgkspike Linux - Newbie 2 02-02-2004 10:08 PM
RPM Question vdi_nenna Linux - Software 3 06-12-2002 09:43 AM
RPM Question AMDPwred Linux - General 4 01-20-2002 07:40 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 12:32 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
Open Source Consulting | Domain Registration