The Red hat package manager is the package installer. Nowadays for a package management we need to use this command while installing any type of packages. The most prominent installer is YUM and RPM based package manager where it is to be used while installing the software’s via command line on AlmaLinux / Rocky Linux / Amazon Linux.
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
- Alma / Rocky / Amazon Linux, etc.
- Using RPM we can
- Install new applications
- Upgrade existing applications
- Remove installed applications
- Query packages
RPM Label Pattern
Firstly this examples is given by using following format
(Package Name)-(Package Version)-(Package Architecture)-(Package Extension)
Methods of Installation
- Standalone Method
- Installing from a Hard disk, CD, DVD or Pen drive
- Network Installation Method
- Network file service (NFS).
- File transfer Protocol(FTP).
First of all 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
Then 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
After that 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
Secondly Create a directory
# mkdir <directory name>
Finally Mount the NFS fie system on the directory
# mount <NFSservip>:<path to the package> <mount Point>
Then 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 query the packages.
- Added from RHEL 5 onward.
- 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 Repository
Lastly 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 repository.
Also Creating the repository
# createrepo –g /media/cdrom/Server/repodate/comps-rhel5-server-core.xml <directory>
To define the path to the repository
Add the following lines
[rhel-debuginfo] name=Red Hat Enterprise Linux $releasever-$basearch- debug baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasver/en/os/$basearch/Debuginfo enable=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
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>
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 repository.
Update To update existing packages.
Congratulations now you have learned the RPM and Yum Commands cheat sheet on AlmaLinux / Rocky Linux / Amazon Linux.