LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 04-08-2015, 12:34 PM   #1
rcslb
LQ Newbie
 
Registered: Apr 2015
Posts: 2

Rep: Reputation: Disabled
Trying to evaluate an RPM


Hello, I'm trying to evaluate a new rpm. I have it downloaded to my home directory on a RHEL 7 sandbox as <package>.rpm and I'm not sure what to do from here to look at it's contents.

Thank you,
rcslb
 
Old 04-08-2015, 12:36 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
http://www.cyberciti.biz/tips/how-to...alling-it.html
 
Old 04-08-2015, 12:58 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
@unSpawn once made this script ( unPack_rpm.sh )
Code:
#!/bin/bash
# Purpose: Unpack RPM archives (unSpawn)
# Args: /path/to/archive
# Deps: Bash, GNU utils, RPM
rpmDetails() { for Q in changelog provides requires scripts triggers triggerscripts; do 
 rpm -q -p --${Q} "${f}" 2>&1 | grep -v NOKEY > "${Q}.log"; done; }
rpmUnpack() { f=$(readlink -f "${f}"); file "${f}"|grep -q "RPM.v" && \
 { d=$(basename "${f}" .rpm); d="./${d:=ERROR_$$}"; mkdir -p "${d}" && \
 { cd "${d}" && rpm2cpio "${f}" | cpio -idmv && rpmDetails "${f}"; }; }; }
for f in $@; do rpmUnpack "${f}"; done
exit 0
... which will unpack an rpm package to a new directory: package-name-version/.


-
 
Old 04-08-2015, 01:01 PM   #4
rcslb
LQ Newbie
 
Registered: Apr 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks. This process worked very well.

Download RPM to my laptop
Copy to a sandbox

$ mkdir test
$ cd test

copy .rpm to test dir

$ rpm2cpio php-5.1.4-1.esp1.x86_64.rpm | cpio -idmv

In this example, output of rpm2cpio command piped to cpio command with following options:

i: Restore archive
d: Create leading directories where needed
m: Retain previous file modification times when creating files
v: Verbose i.e. display progress
 
Old 04-08-2015, 02:44 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
or if all you need is to extract the riles in the rpm
r-click on it and elect "extract here"
but all you will get is the files that would be installed nothing else like what you will get with the script
 
  


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
Evaluate RHEL 6 rlrlemos Linux - Server 2 01-30-2014 12:24 AM
not able to evaluate variable mrajdeep Linux - Newbie 12 09-26-2013 05:57 PM
[SOLVED] shell evaluate problem 915086731 Linux - General 3 09-02-2011 07:34 AM
[SOLVED] How to evaluate the value of a variable ? 915086731 Linux - General 4 08-11-2011 05:03 AM
Somebody evaluate my fstab, Can't hibernate shadogamon Linux - Software 2 07-24-2011 10:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:39 AM.

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