Tuesday, September 22, 2020

RPM Package Management

RPM Package Management



Introduction:


In this blog i am going to explain RPM Package Management, RPM is a default open source and most popular package management utility for Red Hat based systems like RHEL,CENTOS and FEDORA)

The Red Hat Enterprise linux system divided into RPM packages which can be installed ,upgraded or removed,all softwares on a Red Hat Enterprise linux system is divided into RPM packages

The tool allows linux system administrators and users to install,update,uninstall,query,verify and manage system software packages in unix/linux operating systems.RPM package file name will be .rpm

.rpm file that includes compiled software programs and libraries needed by the packages,


RPM Package Management,rpm package,rpm package download,rpm linux command,how to create rpm package in redhat linux,location of rpm packages in linux,how to verify rpm package,rpm file,rpm install,how to check dependencies of rpm package before installing,rpm package manager,redhat package manager


  •    RPM is a free and easily downloaded from rpm sites ,released under the  GPL(General public Licence)    
  •    RPM keeps the information of all the installed packages under this directory /var/lib/rpm database
  •    RPM is the only way to install under the linux/unix systems to update the packages
  •    RPM deals with the .rpm file swhich contains the information about the packages such as dependies info,version info


There are five commands mostly  used in linux/unix for  RPM Package Management


  1. Install : it is used to install any RPM package .rpm file
  2. Remove:it is used to remove or uninstall the RPM packages
  3. Upgrade: it is used to upgrade the existing RPM package in linux/unix systems
  4. Verify : it is used to verify the RPM packages in linux/unix systems
  5. Query:it is used to query any RPM package



Below are the websites you can find and download  RPM Package Management


https://rpmfind.net/

https://www.redhat.com/en

https://rpm.org/download.html



Now Let us start the process  RPM Package Management


RPM is a popular utility for installing software on unix/linux systems


Step 1: Log in as root user on which you want to install the software you can manage the RPM commands by using root user privileges


Step 2: Download the RPM package you wish to install the package named some thing like java rpmpackage name  jre-8u111-linux-i586.rpm,the file name include version (1.0,8), release(1,u111) and architecture is (i386,i586)


Step 3: Check the PGP signature of packages before installing them on your linux systems make sure the integerity and origin is correct by using the following command  checksig(check signature)option to check signature of a package called pidgin


[root@chaitanyaoracledba]# rpm --checksig jre-8u111-linux-i586.rpm


jre-8u111-linux-i586.rpm: rsa sha1 (md5) pgp md5 OK



INSTALL A PACKAGE



[root@chaitanyaoracledba]# rpm - Uvh jre-8u111-linux-i586.rpm


Preparing...                ########################################### [100%]

   1:jre1.80_111           ########################################### [100%]


RPM commands and options



  •     -i : install a package
  •     -v : verbose for a nicer display of package
  •     -h: print hash marks as the package archive is unpacked.



If a package with same name and version is already installed below output will show like this


[root@chaitanyaoracledba]# rpm - Uvh jre-8u111-linux-i586.rpm


Preparing...                ########################################### [100%]

           package jre1.8.0_111-1.8.0_111-fcs.i586 is already installed




However if you want to install the package anyway, youcanuse --replacepkgs option 


[root@chaitanyaoracledba]# rpm - ivh --replacepkgs jre-8u111-linux-i586.rpm

Preparing...                ########################################### [100%]

   1:jre1.8.0_111           ########################################### [100%]




 Force, option which tells RPM to ignore the error  


[root@chaitanyaoracledba]# rpm - ivh jre-8u111-linux-i586.rpm -- force

Preparing...                ########################################### [100%]

   1:jre1.8.0_111           ########################################### [100%]



If you attempt to install a package that contains a file which already been installed by another package below output show like this



[root@chaitanyaoracledba]# rpm-Uvh foo-1.0-1.i386.rpm

Preparing... ...               ########################################### [100%]

file   /usr/bin/foo from install of foo-1.0-1 conflicts with file from package bar-2.0.20



To make RPM ignore this error ,use the replacefiles option


[root@chaitanyaoracledba]# rpm-ivh--replacefiles  foo-1.0-1.i386.rpm



RPM packages may sometimes depend on other packages which requires other packages to be installed on the linux/unix system 


if u try to install a package which has an unresolved dependency package the below output shows like this


error : Failed dependencies:

bar.so.2 is needed by foo-1.0-1

suggested resolutions:

bar-2.0.20-.i386.rpm


If you are installing a pacakage ,it usually suggest the package needed to resolve the dependency


Download suggested packages from redhat sites and add it to the command


rpm -ivh foo-1.0-1.i386.rpm bar-2.0.20-3.i386.rpm



if both the packages are installed sucessfully it will show like this 


Preparing... ...               ########################################### [100%]  


                1:foo  ########################################### [100%]  

                2 :bar ########################################### [100%]  


if it does not suggest a package to resolve the dependency ,you cantry the --redhatproviders option to determine which package contains the required file


[root@chaitanyaoracledba]# rpm -q --redhatproviders bar.so.2


you need the rpmdb-redhat package installed to use this option


bar-2.0.20-3.i386.rpm



To force the installtion anyway,use the -nodeps option


[root@chaitanyaoracledba]# rpm-ivh  foo-1.0-1.i386.rpm --nodeps



UNINSTALL  A PACKAGE


To remove the uninstall package use the - erase option


[root@chaitanyaoracledba]# rpm - e jre1.8.0_111



UPGRADE A PACKAGE


To upgarde the package  RPM automatically uninstalls any old versions use the -U option  will install a package when there are no previous versions of the package installed 


[root@chaitanyaoracledba]# rpm - Uvh jre-8u111-linux-i586.rpm



FRESHENING A PACKAGE


Freshning a package similar to upgrading except that only existing packages are upgraded below is the command


[root@chaitanyaoracledba]# rpm - Fvh jre-8u111-linux-i586.rpm



QUERY DATABASE


To query this database use the -q option ,The rpm -q  package name command displays the package name,version,and relese number of the installed package name


 [root@chaitanyaoracledba]# rpm -q jre1.8.0_111

                                                 jre1.8.0_111-1.8.0_111-fcs.i586



Check all the installed package on the system


[root@chaitanyaoracledba]# rpm -qa




check whether particular package is installed or not


[root@chaitanyaoracledba]# rpm -q jre1.8.0_111

                                                 jre1.8.0_111-1.8.0_111-fcs.i586


Check a package is consistent or not before installing it


[root@chaitanyaoracledba]# rpm -ivh --test jre-8u111-linux-1586.rpm


       Preparing...                ########################################### [100%]



To see the information about the installated package use below command to show


[root@chaitanyaoracledba]# rpm -qi jre1.8.0_111



To see the configuration file of the installed package use below command to show


[root@chaitanyaoracledba]# rpm -qlc jre1.8.0_111



To see the directory with which a particular package is associated


[root@chaitanyaoracledba]# rpm -qld jre1.8.0_111



Note : Info on RPM Package Management it may be differ on your environment like development,testing,production and naming conventions etc



THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME AND SUBSCRIBE ME


No comments:

Post a Comment

ITIL Process

ITIL Process Introduction In this Blog i am going to explain  ITIL Process, ITIL stands for Information Technology Infrastructure Library ...