HomePage » Linux » LinuxRPM


RPM options

rpm --prefix install packages into a different prefix, if possible
rpm -qa --last show installed packages, sort by date of install
rpm -pql package.rpm show files in an rpm file
rpm2cpio package.rpm | cpio -idmv extract rpm package
up2date --arch=i386 glibc install specific rpm of architecture, esp useful on x86_64 platform
up2date --get-source kernel Get kernel source
rpm -qa | xargs up2date --tmpdir=$PWD --get Obtain a list of installed RPM and download them to CWD


List detail info on rpm:
rpm -qa --queryformat '|%{NAME}|%{VERSION}|%{RELEASE}|%{ARCH}|\n' package_name

Cleaning RPM db

Sometimes, RPM gets stuck. Read this http://people.redhat.com/berrange/notes/rpmrecovery.html or simply remove /var/lib/rpm/_ _db* will do the trick.


Repackage

Install a package from an older version
rpm -Uvh --oldpackage foo-1-1.i386.rpm


Repackage the old package before upgrading the new one
rpm -Uvh --repackage foo-1-2.noarch.rpm


Remove package with rollback info
rpm -e --repackage foo


Rollback the upgrade
rpm -Uvh --rollback '2 hours ago'


Reference: http://www.linuxjournal.com/article/7034
Comments [Hide comments/form]
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki