RPM and YUM package management practical guide in linux with examples for beginners


RPM and YUM package management practical guide in linux with examples for beginners

In this article we learn how to query, install, upgrage  and remove a package using rpm and yum repository  and also learn how to configure yum repository and verify the repository whether it is correctly configured or not.

What is Package

Package is basically a file which is gather all information for the particular software. In the linux operating system all software is installed by the packages.
Lets take an example when we want to install apache software for create website we need http package .

Query a Package

To query a package we execute the below command.

#rpm –qa <package name>

Here we want to query http package so we put http in the place of <package name> and execute the command.

# rpm -qa httpd

Install /upgrade/remove  a Package

If we don’t get any output by executing the query command  that means the package is not installed on the system. We need to install the package. First we need to mount the redhat dvd on the system.You can use iso image to mlount it by executing the below command.

#mount -0 loop –t iso9660 /dev/cdrom /mnt
#rpm –ivh  httpd

Here “-i” switch use for install the package.”-v” switch use for verbose mode and “-h” switch use for hash promt. After executing the command we installed the web package on the system. After installed it we need to query it whether it is installed or not.

If you get the dependancy error during installation you can use "--nodeps" and "--force" along with the installation command.

[root@localhost ~]#  rpm -qa httpd
httpd-2.2.15-29.el6_4.x86_64

RPM and YUM package management practical guide in linux with examples for beginners
RPM and YUM package management practical guide in linux with examples for beginners

To upgrade the package we execute the below command .

#rpm –Uvh  httpd
Here “-U” switch use for upgrade the package ,”-v” switch for verbose mode and “-h” switch use for hashing.
To remove the package using rpm execute the below command.
#rpm –e  httpd
Here “-e” switch use for erase purpose. After executing the command all httpd package will be erased from the system.


YUM package management practical guide in linux with examples for beginners



SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment