Home > Others > RPM Command Cheat Sheet

RPM Command Cheat Sheet

RPM (Redhat Package Manager) is the most popular package utility and is used mostly on RHEL, Centos and Fedora.
RPM helps user/admins to build, install, query, verify, update, and remove/erase individual software packages.
More information can found rpm.org and techmint.com

Install Package

rpm -ivh [__rpmfile__]    
rpm -ivh vim-common-7.4.629-5.el6.i686.rpm
rpm -ivh --test vim-common-7.4.629-5.el6.i686.rpm

Upgrade Package

rpm -Uvh [__rpmfile__]    
rpm -Uvh vim-common-7.4.629-5.el6.i686.rpm
rpm -Uvh --test vim-common-7.4.629-5.el6.i686.rpm

Erase/Uninstall Package

rpm -ev [__package_name__]    
rpm -ev vim-common

Erase/Uninstall an installed package without checking for dependencies

rpm -ev --nodeps [__package_name__]    
rpm -ev --nodeps vim-common

List all installed packages

rpm -qa        
rpm -qa | grep vim 

Information along with package version and short description

rpm -qi [__package_name__]        
rpm -qi vim-common

Find out what package a file belongs to i.e. find what package owns the file

rpm -qf [__/path/to/file__]        rpm -qf /etc/passwd
rpm -qf /bin/bash

Display list of configuration file(s) for a package

rpm -qc [__pacakge_name__]
rpm -qc httpd

Display list of configuration files for a command

rpm -qcf [__/path/to/file__]        
rpm -qcf /usr/X11R6/bin/xeyes

Display list of all recently installed RPMs

rpm -qa --last        
rpm -qa --last
rpm -qa --last | less

Find out what dependencies a rpm file has

rpm -qpR [__rpmfile__]
rpm -qR [__package_name__]

rpm -qpR vim-common-7.4.629-5.el6.i686.rpm
rpm -qR bash

from Blogger http://ift.tt/2bo27sh
via IFTTT

Advertisements
Categories: Others Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: