Yum Command Line Options

What is YUM?

                                YUM (Yellowdog Updater Modified) is the primary tool for getting, installing, deleting, querying, and managing  RPM software packages based on Linux machines. Yum can be installed using various third party repositories over the network.


[1] Checking for Updates:

To check which installed packages having available updates on your system:

[root@quickfixlinux ~]# yum check-update 


[2] Updating the packages are available in different ways, as like updating the entire package, single package or multiple packages at once. 

[2.1] Updating the Single package:

[root@quickfixlinux ~]# yum update nmap 


[2.2] Updating the multiple packages:    

[root@quickfixlinux ~]# yum update rpm nmap perl python 


 [2.3] Updating entire packages:

[root@quickfixlinux ~]# yum update 


[3] Updating Security Related patches:

If you really want to update only the security related patches to the latest version:

[root@quickfixlinux ~] # yum update – –security 

You can also update packages only to the version contains the latest security updates:

[root@quickfixlinux ~]# yum update-minimal  – –security 

For example, assume that: the kernel-3.10.0-1 package is installed on your system; the kernel-3.10.0-2 package was released as a security update; the kernel-3.10.0-3 package was released as a bug fix update. Then yum update-minimal – –security updates the package to kernel-3.10.0-2, and yum update – –  security updates the package to kernel-3.10.0-3.


[4] Searching for the packages using yum:

To search and list all the packages that match to “nmap” , “rpm” and “perl”

[root@quickfixlinux ~]# yum search nmap rpm perl 


[4.1] If you would like to search all the packages, make use of the below command :

[root@quickfixlinux ~]# yum search all


[5] Listing of Packages:

To List all the installed and available packages, make use of the below command:

[root@quickfixlinux ~]# yum list all 


[5.1]  To list all installed version of perl package:

[root@quickfixlinux ~]# yum list installed “perl?*” 


[5.2] To list the packages in the enabled repository that are available to install:

        # yum list available perl\*  

[6] Listing Repositories:

To list the repository ID, Name and Number of packages for each enabled repository on your machine:

[root@quickfixlinux ~]# yum repolist  


[6.1] To list more information about the repositories with details info, make use of the below commands:

[root@quickfixlinux ~]# yum repolist -v

[root@quickfixlinux ~]# yum repoinfo  


[6.2] To list both enabled and disabled repositories, make use of the following command :

  [root@quickfixlinux ~]# yum repolist all  


 [7] Displaying package information:

To display information about one or more packages, make use of the following command:

     

[root@quickfixlinux ~]# yum info nmap 


[7.1] Using “yumdb” command is also an alternative and useful command to query about a package:

             

[root@quickfixlinux ~]# yumdb nmap 


[8] Installing packages:

 [8.1]  To install a Single package and all of its non-installed dependencies, using yum command:

             

[root@quickfixlinux ~]# yum install glibc 


[8.2] To install multiple packages as below:  

             

[root@quickfixlinux ~]# yum install glibc nmap 


 [8.3] Installing packages with global expressions:  

                 

[root@quickfixlinux ~]# yum install glibc-\*


[8.4] In addition to packages and global expression used for installing through yum, you can also provide the file name of the binary path to install.

 

[root@quickfixlinux ~] # yum install /usr/sbin/named 


[8.5] Assume you know the package name and you don’t know the named binary path which might in /bin or /sbin, directory in which the package is installed. Make use of the following command to find out:

[root@quickfixlinux ~]# yum provided “*bin/named” 


[8.6] Removing Packages:        To uninstall the package using the yum remove command options:

                   

[root@quickfixlinux ~]# yum remove named 


[9]  Group Installation of Packages:

[9.1] Listing of Package groups:   

The Summary option is used to view the number of Installed groups, Available environment groups,  and both installed and available language groups.

         

[root@quickfixlinux ~]# yum group summary


[9.2] To List all package groups from yum repositories:

               

[root@quickfixlinux ~]# yum group list


[9.3] There are some groups which are hidden by settings in the configured repositories. To list of the hidden groups, please make us of the below command:

             

[root@quickfixlinux ~] # yum groups list hidden ids 


[10] To install using group :

                

[root@quickfixlinux ~]# yum group install “group name”


[10.1]  You can also install using the group id:

               

[root@quickfixlinux ~]# yum group install < group id >


[10.2] You can also pass the GroupID or Quoted groupname to install command if you prepend it with an @ symbol in front of it.

                   

[root@quickfixlinux ~]# yum install @”X Window System”

[root@quickfixlinux ~]# yum group install “X Window System”


[11] Listing Transactions:

To display a list of twenty most recent transactions.

                

[root@quickfixlinux ~]# yum history list


[11.1] To Display all Transactions: 

                       

[root@quickfixlinux ~]# yum history list all


 [11.2] To Display transactions in a given range:

                    

[root@quickfixlinux ~]# yum history list start_id … end_id

                  


[11.3] To synchronize the rpmdb and yumdb database contents for any installed packages with the currently used rpmdb or yumdb database, make use of the below command:

               

[root@quickfixlinux ~] # yum history sync


[11.4] To display the overall statistics about the currently used history database:

                       

[root@quickfixlinux ~]# yum history stats


[11.5] To Display the summary of past transactions:

              

[root@quickfixlinux ~]# yum history summary


[11.6] To trace the history of glibc and related packages, type the following command:

                      

[root@quickfixlinux ~]# yum history packages-list glibc\*


[11.7] To start a new transaction history:

      This will create a new, empty database file in the /var/lib/yum/history/ directory. The old

transaction history will be kept, but will not be accessible as long as a newer database file is present

in the directory.

                    

[root@quickfixlinux ~]# yum history new

……..


 

You may also like...

2 Responses

  1. vroot apk says:

    Way cool! Some extremely valid points! I appreciate you writing this post plus the rest of the site is really
    good.

Leave a Reply