rpm
Summary
The rpm command is used to install/uninstall package.
Usage
Test install rpm package
At times you want to perform a test run of a packages installation.
# rpm -ivh --test <package>.rpmInstall rpm package only
To just install a package which does not include upgrading an already installed package:
# rpm -ivh kernel-<kernel_version>.<arch>.rpmThe above example is great for when upgrading kernels. Best practice is to install the second kernel along side the existing kernel in case there are issues with installing the new kernel. With both installed, it makes it easy to rollback the changes.
Install an old rpm package
# rpm -ivh --oldpackage kernel-<kernel_version>.<arch>.rpmInstall/Upgrade rpm package
To upgrade/install a package, log in as root and type the following command at a shell prompt:
# rpm -Uvh foo-1.0-1.i386.rpmUninstall rpm package
# rpm -e <package>.rpmReinstall rpm package
# rpm -iv --replacepkgs <package>.rpmList config files of package
# rpm -q --configfiles <package>.rpmList contents of an uninstalled rpm
# rpm -qpl <rpm>.rpmViewing the contents of an uninstalled package may be useful when building your own rpms with rpmbuild.
Check if config files have been modified from the default
# rpm -V <package>.rpmModify the output of rpm using queryformat parameters
Query formats are modified versions of printf. The format is made up of static strings of allowed tag surrounded by %{}.
View available tags
# rpm --querytagsPrint only the name of pakcages
Print only the names of the packages queried, you could use %{NAME} as the format string.
# rpm -qa --qf "%{NAME}\n"Referenced commands: rpmbuild