Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying information on non-installed RPM package?

Tags:

package

rpm

I googled for this, but couldn't find how to query a non-installed RPM file for its information:

# rpm -qa blackfin-jtag-tools-09r1.1-2.i386.rpm #  # rpm -qi blackfin-jtag-tools-09r1.1-2.i386.rpm package blackfin-jtag-tools-09r1.1-2.i386.rpm is not installed #  # rpm -q blackfin-jtag-tools-09r1.1-2.i386.rpm package blackfin-jtag-tools-09r1.1-2.i386.rpm is not installed #  # rpm --info  blackfin-jtag-tools-09r1.1-2.i386.rpm RPM version 4.8.0 Copyright (C) 1998-2002 - Red Hat, Inc. This program may be freely redistributed under the terms of the GNU GPL  Usage: rpm [-aKfgpWHqVcdilsKiv?] [-a|--all] [-f|--file] [-g|--group] [-p|--package] [-W|--ftswalk] [--pkgid] [--hdrid] [--fileid]         [--specfile] [--triggeredby] [--whatrequires] [--whatprovides] [--nomanifest] [-c|--configfiles] [-d|--docfiles]         [--dump] [-l|--list] [--queryformat=QUERYFORMAT] [-s|--state] [--nofiledigest] [--nomd5] [--nofiles] [--nodeps] [...] 

Is there a command to read information out of non-installed RPM file?

like image 359
Gulbahar Avatar asked Jun 09 '10 12:06

Gulbahar


People also ask

How can I see the contents of an rpm without installing?

You can get a listing of the files inside an RPM by performing an RPM query and adding the “-p” switch: $ rpm -q -l -p bash-3.1-16.1. x86_64. rpm /bin/bash /bin/sh /etc/skel/.

How do I test an rpm before installation?

To test the rpm package before installation we will use the --test option with rpm command. The command will not install rpm but it will only test the package. Syntax: Replace the PACKAGE-NAME.

What utility will extract files from an RPM package without installing the package?

Extracting rpm file using combination of rpm2cpio and cpio command.


2 Answers

rpm -qip foo.rpm

like image 53
crazyscot Avatar answered Sep 22 '22 05:09

crazyscot


@crazyscot did answer the question. Thanks.

Additionally, I found that specific querytags can also be leveraged this way, which wasn't obvious from reading the man page. So, for example, I found I can do the following:

    rpm -qp --queryformat '%{ARCH}\n' foo.rpm 

or, even:

    xyz="ARCH";  rpm -qp --qf %{${xyz}}  foo.rpm; echo "" 

This works nicely for RPM's that are not installed, and leveraging the available querytags in the installed rpm

Here is more information about tags

like image 41
Joseph Wulf Avatar answered Sep 22 '22 05:09

Joseph Wulf