Changes from Version 1 of RpmCommands

Show
Ignore:
Author:
skvidal (IP: 24.211.246.61)
Timestamp:
11/04/08 20:41:12 (9 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RpmCommands

    v0 v1  
     1= Useful (and lesser-known) rpm commands = 
     2 
     3This is just a short list of useful and not-terribly-well-known commands 
     4you can run with the rpm command line. If you can think of more to add that 
     5you've used, please feel free to email us to include them. 
     6 
     7 
     8 {{{ 
     9    rpm -qa --last 
     10 }}} 
     11 
     12   This command outputs all installed packages and their installation time in  
     13   reverse order. So, the most recently installed package will be listed first.  
     14 
     15=== Example output === 
     16{{{ 
     17$ rpm -qa --last | head -14 
     18gnome-python2-gtkhtml2-2.19.1-16.fc9          Thu 17 Jul 2008 11:40:44 PM EDT 
     19gnome-python2-libegg-2.19.1-16.fc9            Thu 17 Jul 2008 11:40:43 PM EDT 
     20gnome-python2-gtkmozembed-2.19.1-16.fc9       Thu 17 Jul 2008 11:40:43 PM EDT 
     21gnome-python2-extras-2.19.1-16.fc9            Thu 17 Jul 2008 11:40:42 PM EDT 
     22kernel-2.6.25.11-93.fc9                       Thu 17 Jul 2008 04:01:13 PM EDT 
     23hugin-0.7.0-0.3.20080528svn.fc9               Tue 15 Jul 2008 11:24:37 PM EDT 
     24hugin-base-0.7.0-0.3.20080528svn.fc9          Tue 15 Jul 2008 11:24:35 PM EDT 
     25enblend-3.1-0.5.20080529cvs.fc9               Tue 15 Jul 2008 11:24:34 PM EDT 
     26perl-Image-ExifTool-7.25-2.fc9                Tue 15 Jul 2008 11:24:29 PM EDT 
     27glew-1.5.0-2.fc9                              Tue 15 Jul 2008 11:24:28 PM EDT 
     28boost-1.34.1-13.fc9                           Tue 15 Jul 2008 11:24:27 PM EDT 
     29libicu-3.8.1-7.fc9                            Tue 15 Jul 2008 11:24:25 PM EDT 
     30plotutils-2.5-5.fc9                           Tue 15 Jul 2008 11:24:23 PM EDT 
     31libpano13-tools-2.9.12-7.fc9                  Tue 15 Jul 2008 11:24:22 PM EDT 
     32 
     33}}} 
     34 
     35{{{ 
     36   rpm -qa --qf "%{size} %{name}.%{arch}\n" | sort -n 
     37}}} 
     38 
     39   This command displays the size (in bytes) and name.arch of all packages on 
     40   the system and sorts them by their size from smallest to largest. This is  
     41   useful for finding out which packages on your system are taking up a lot of 
     42   space. Used carefully it can help you clean up unneeded space-consuming 
     43   packages. 
     44 
     45=== Example === 
     46{{{ 
     47$ rpm -qa --qf "%{size} %{name}.%{arch}\n" | sort -n 
     4822429792 Miro.i386 
     4922495239 xulrunner.i386 
     5023553254 anthy.i386 
     5127332634 fonts-japanese.noarch 
     5228805881 ghostscript.i386 
     5329475842 foomatic.i386 
     5429613520 selinux-policy-targeted.noarch 
     5532793230 gnumeric.i386 
     5636362111 gnome-games.i386 
     5738401148 gimp.i386 
     5840969098 evolution.i386 
     5941452165 perl.i386 
     6042001812 mono-core.i386 
     6146827945 samba-common.i386 
     6248317271 libgweather.i386 
     6349798328 gutenprint-foomatic.i386 
     6452051447 kernel.i686 
     6552058430 kernel.i686 
     6652071231 kernel.i686 
     6791610549 glibc-common.i386 
     68}}} 
     69 
     70  
     71{{{  
     72   rpm --showrc 
     73}}} 
     74    
     75   This command shows rpm resource configuration state. Very helpful if you 
     76   are trying to figure out what variable definition you can use in a spec  
     77   file. The output from this command is fairly long and complicated, it may 
     78   benefit you to pipe it to less (rpm --showrc | less). 
     79 
     80{{{ 
     81   rpm -Va --nofiles --nomd5 
     82}}} 
     83 
     84   This command checks your system's rpmdb for all unresolved dependencies,  
     85   conflicts or other package-related problems. In the best (and normal) 
     86   case it should return nothing at all. 
     87 
     88{{{ 
     89   rpm --eval <an rpm macro> 
     90}}} 
     91   This lets you output what rpm would return from the macro or command you  
     92   specify. This will take pretty much anything you would normally preface 
     93   with a % in a spec file. 
     94    
     95=== Example === 
     96{{{ 
     97$ rpm --eval "%{_arch} %{_bindir}" 
     98i386 /usr/bin 
     99}}} 
     100 
     101 
     102