rpm -qp --scripts package.rpm

show rpm packages scriptlets

Sample Output
warning: /var/cache/yum/as-3-u8-i386/packages/screen-3.9.15-10.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
postinstall scriptlet (using /bin/sh):
/sbin/install-info /usr/share/info/screen.info.gz /usr/share/info/dir --entry="* screen: (screen).             Terminal multiplexer."
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
    /sbin/install-info --delete /usr/share/info/screen.info.gz /usr/share/info/dir --entry="* screen: (screen).             Terminal multiplexer."
fi

2
By: gerard
2011-01-04 14:38:14

These Might Interest You

  • Shows the packages installed on your system that are recomemnded by other packages. You should remove these packages. Show Sample Output


    1
    aptitude search '?and( ?automatic(?reverse-recommends(?installed)), ?not(?automatic(?reverse-depends(?installed))) )'
    wei2912 · 2012-07-28 05:45:21 0
  • This command lists all packages in a yum based system that no other packages depend on. Hence, these packages are good candidates for removal. It's a great command for cleaning up a yum based distribution after installation. Show Sample Output


    0
    package-cleanup --leaves --all
    drebes · 2009-02-05 13:51:27 0
  • After you install/remove lots of packages, there are many packages marked with 'rc'. This script help you to purge these packages, it will save some spaces from your disk.


    2
    sudo dpkg --purge `dpkg -l | awk '/^r/{print $2}'`
    elleryq · 2009-02-16 02:18:02 3
  • I sometimes want to know what packages are installed on my Ubuntu system. I still haven't figured out how to use aptitude effectively, so this is the next best thing. This allows finding by name. The grep '^ii' limits the display to only installed packages. If this is not specified, then it includes listing of non-installed packages as well. Show Sample Output


    1
    dpkg --list '*linux*' | grep '^ii'
    piyo · 2009-02-13 17:05:37 1
  • This, like the other commands listed here, displays installed arch packages. Unlike the other ones this also displays the short description so you can see what that package does without having to go to google. It also shows the largest packages on top. You can optionally pipe this through head to display an arbitrary number of the largest packages installed (e.g. ... | head -30 # for the largest 30 packages installed) Show Sample Output


    -1
    pacman -Qi | grep 'Name\|Size\|Description' | cut -d: -f2 | paste - - - | awk -F'\t' '{ print $2, "\t", $1, "\t", $3 }' | sort -rn
    GetterNoCheddar · 2012-11-20 03:40:55 0
  • Clears the package cache of all packages, installed and uninstalled packages. Do NOT USE if you might want to downgrade a package later.


    0
    sudo pacman -Scc
    ibnarrashid · 2011-03-20 20:57:42 0

What Others Think

I always do this before I install an RPM package. Also try: rpm -qpi package.rpm <-- Shows package info rpm -qpl package.rpm <-- Shows list of all files rpm -qpd package.rpm <-- Shows list of documentation files rpm -qpc package.rpm <-- Shows list of config files
SuperFly · 384 weeks and 6 days ago
Also works for already installed packages: rpm -q --scripts package
hfs · 278 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: