Saturday, March 21, 2009

RPM command

rpm -e xyz = removes package xyz
rpm -e –nodeps xyz-5.6.fc5.i386 = removes 32+ bit version of package if more versions available
rpm -ivh xyz.rpm = install package xyz (i=install, v=verbose, h=hash)
rpm -ivh http://ftp.abc.com/xyz.rpm = install package xyz from the site
rpm -Uvh xyz.rpm = update package xyz (U=update)
rpm -q --scripts kernel |less = list of all preinstall & post-install scripts
rpm -q php = php version no.
rpm -qi php = php install info
rpm -qi fedora-release = Fedora installation info
rpm -qi php/per/python/ruby = version info for the package
rpm -qa grun = prints grub version no.
rpm -qa php = prints php version no.


rpm -qa | grep php = prints version nos. of all php related packages
rpm -qa | head = only 10 softwares listed
rpm -qa | head -n5 = first 5 software listed
rpm -qa | wc -l = total no of packages installed on the system
rpm -ql php = lists all files in a particular package
rpm -qal | grep php = find php in all installed packages
rpm -ql php | wc -l = total no. of files in a particular package
rpm -qa | grep php | wc -l = count the total number of php modules
rpm -qf /var/lib/php = what package a particular file belongs to
rpm -q --scripts mysql = scripts of a package
rpm -qa php | wc -l = total no. of php packages
rpm -qi php = info about php
rpm -q –last php = installation date of php
rpm -qi php | grep -i vendor = php vendor name
rpm -qi fedora-release | grep -i vendor = prints vendor name from a file named fedora-release
rpm -v = rpm version


rpm -qa --queryformat '%{NAME}==%{VENDOR}\n' | grep -v "Red Hat" | sort = list of installed packages with their vendor names except Red Hat
rpm -qa --qf '%{NAME}==%{VENDOR}\n' | grep "Red Hat" | sort = list of installed packages with their vendor name as Red Hat
rpm -qa --qf '%{NAME}==%{VENDOR}\n' | sort = list of installed packages with their vendor names
rpm -qa --qf '%{NAME}==%{VENDOR}\n' | grep "Red Hat" | wc -l = total number of installed packages with Red Hat as their vendor


rpm -qa --qf '%{NAME}==%{LICENSE}\n' | sort = list of all installed packages with their licence type sorted alphabetically
rpm -qa --qf '%{NAME}==%{LICENSE}\n' | wc -l = total number of installed packages with their licence type
rpm -qa --qf '%{NAME}==%{LICENSE}\n' | grep php | sort = list of all php packages with their licence types sorted alphabetically
rpm -qa --qf '%{NAME}==%{LICENSE}\n' | grep php | wc -l = total number of all php packages with their licence types



rpm -qa --qf '%{NAME}==%{SIZE}\n' | sort = list of all installed packages with their names and sizes in bytes sorted alphabetically
rpm -qa --qf '%{NAME}==%{SIZE}\n' | grep php | sort = list of all php packages with their names and sizes in bytes sorted alphabetically
rpm -qa --qf '%{NAME}==%{SIZE}\n' | grep php | wc -l = total number of installed php packages with their names and sizes in bytes



rpm -qa --qf '%{NAME}==%{SUMMARY}\n' | sort = list of all installed packages with their names and functions sorted alphabetically
rpm -qa --qf '%{NAME}==%{SUMMARY}\n' | grep php | sort = list of all php packages with their names and functions sorted alphabetically
rpm -qa --qf '%{NAME}==%{SUMMARY}\n' | grep php | wc -l = total number of all php packages with their names and functions


rpm -qa --qf '%{NAME}==%{BUILDHOST}\n' | sort = list of all installed packages with their names and buildhosts sorted alphabetically
rpm -qa --qf '%{NAME}==%{BUILDHOST}\n' | grep php | sort = list of all php packages with their names and buildhosts sorted alphabetically
rpm -qa --qf '%{NAME}==%{BUILDHOST}\n' | grep php | wc -l = total number of all php packages with their names and buildhosts


rpm -qa --qf '%{NAME}==%{URL}\n' | sort = list of all installed packages with their names and urls sorted alphabetically
rpm -qa --qf '%{NAME}==%{URL}\n' | grep php | sort = list of all php packages with their names and urls sorted alphabetically
rpm -qa --qf '%{NAME}==%{URL}\n' | grep php | wc -l = total number of all php packages with their names and urls


rpm -qa --qf '%{NAME}==%{ARCH}\n' | sort = list of all installed packages with their names and architecture type sorted alphabetically
rpm -qa --qf '%{NAME}==%{ARCH}\n' | grep php | sort = list of all php packages with their names and architecture type sorted alphabetically
rpm -qa --qf '%{NAME}==%{ARCH}\n' | grep php | wc -l = total number of all php packages with their names and architecture type



rpm –querytags = list of all rpm query tags
rpm –querytags | wc -l = total number of rpm tags
rpm -Va = verify all installed packages
rpm -Va | grep php = verify php packages only
rpm -Vv | grep php = check php packages only with verbose

No comments:

Post a Comment