Connect with us

Hi, what are you looking for?


RPM and YUM Commands Cheat Sheet for CentOS 7

Package Management (RPM & YUM) Commands for RHEL and Fedora Based Linux Distributions

Redhat Package Manager (RPM)

  • RPM is both a installation method as well as a package format.
  • RPM packages were original created of Red Hat Linux, but now can be used on many Linux distributions like
  • red Hat enterprise Linux, fedora, SUSE, Mandriva, etc.
  • Using RPM we can
  • Install new applications
  • Upgrade existing applications
  • Remove installed applications
  • Query packages
RPM Label Pattern

this examples is given by using following format

(Package Name)-(Package Version)-(Package Architecture)-(Package Extension)

Methods of Installation
  • Standalone Method
  • Installing from a Harddisk, CD, DVD or Pendrive
  • Network Installation Method
  • Network file service (NFS).
  • File transfer Protocol(FTP).
Standalone Installation
Installing a package
[]# rpm <options> <package name>  --force

-I             install                                                    -U           Update existing package
-v            Verbose                                               –force  Install the package forcefully
-h            Displays the progress in hashes

Removing  an Installed Package
Removing a Package
[]# rpm <options> <package name> --nodeps

-e                            Erase (uninstall)
–nodeps             Uninstall the package even if other applications are dependent on this application

Querying an Installation
Installing a package
[]# rpm <options ><Package name>

-q            Query the availability of the package
-qa         Displays all installed packages
-qc          Displays the configuration files of the package
-qi           Displays the information of the package
-ql           Displays all the files associated with the installed package

Network Installation Method – NFS
Create a directory
[]# mkdir <directory name>
Mount the NFS fie system on the directory
[]# mount <NFSservip>:<path to the package> <mount Point>
To install the package
[]# cd <mount point>
[]# rpm <option><package>  --force
Network Installation Method –FTP
To install the package
[]# rpm <options> ftp://<FTPserver><path > --force

Yellowdog Updater Modification (YUM)

  • It is an interactive use to Install, Remove, upgrade or qury the packages.
  • Added from RHEL 5 onwards.
  • YUM uses an repository that is xml-based rpm metadata for installation.
  • It automatically computes dependencies and figures out what things should occur to install packages.
  • It can be used to installed from a local media, ftp server or nfs server.
To create a Respository
On the local machine
  • Create a directory.
  • Copy the packages into this directory.
  • Install the package createrepo*.rpm.
  • Insert the 1st OS cd
  • Create the respository.
Creating the repository
[]# createrepo –g /media/cdrom/Server/repodate/comps-rhel5-server-core.xml <directory>
Client Configuration
To define the path to the repository
[]# vi/etc/yum.repos.d/rhel-debuginfo.repo

Add the following lines

name=Red Hat Enterprise Linux $releasever-$basearch- debug


Client Configuration
For local machine- change the highlighted line to
baseurl=file:///<path to the directory containing the dumps>
Through ftp – change the highlighted line to
Baseurl=ftp://<ftpserver><path to the directory containing the dumps>
YUM Command
Installing a package
[]# yum <option> <package name1>* <package name2>*

List                         Display the list of packages in the repository.
List installed       Displays the packages that are already installed.
Remove               To erase or remove a packages.
Install                    Installs the package from the respository.
Update                 To update existing packages.
Congratulations now you have learned Package Management (RPM & YUM) Commands for RHEL and Fedora Based Linux Distributions. 

Advertisement. Scroll to continue reading.

You May Also Like


How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...


Internet is the most important public network for connecting to the WEB. For internet connection requirement the ISP is required as well as it...


How to download and install the Mobile Intel 4 Series Express Chipset Graphics Drivers for Windows 10.  Windows 10 is the one of the...


How to Install and Configure PCSX2 on Windows 10. The Windows 10 is the most recommended operating system for the Games. In stream platform...