Friday, June 13

21 Linux YUM Command examples - Redhat/CentOS/Fedora


YUM(Yellowdog Update Modifier) is a default package management tool in Redhat/ CentOS.By using yum tool we can install, upgrade,remove the packages and also we can see the information about packages.YUM also takes care of resolving and installing any dependencies for you, which rpm command can’t do.

                 YUM is an interactive tool which waits for the confirmation of a user, using this tool we can install the required package with dependencies.

                YUM Configuration in Linux - Redhat/CentOS/Fedora

For installing/Uninstalling/remove/update/etc.. a packages with yum :

 Syntax : # yum <option> <command> <pkg-name>
             Options :
                     c -  specifies the location of config file
                     q – Specifies quit, no output

                     y – To always answer yes to prompts

                     v – Provides verbose output

        Here we are see the YUM Command examples

 1. To see the list of packagesb in index i.e repository

             # yum list

2. To see list of installed packages

             # yum list installed | less

3. To install a package

            # yum install <package-name>

   Ex:   # yum install ssh*  -y

       Where  ‘ y ‘ means without confirmation

4. Upgrate an package using update command

        # yum update <package-name>

Ex : # yum update all

      Where update all packages in our server

5. To search a package using yum search

         # yum search <package-name>

  Ex :  # yum search firefox

6. To see information of a particular package

       # yum info <package-name>

Ex : # yum info cat

7. To see list of all available packages using yum list

     # yum list | less

8. Erase a package using yum remove

        # yum remove <package-name>

Ex:   # yum remove zip

9. To see list of all available Group-Package using yum grouplist

    # yum grouplist | less

10. Check for available update using yum

     # yum check-update

11. Install a group packages using yum groupinstall

       # yum groupinstall ‘Mysql Database’

12. Update a group of packages using yum groupupdate

      # yum groupupdate ‘Mysql Database’

13. Erase a group-packages using yum groupremove

     # yum groupremove ‘Mysql Database’

14. To see list of enabled Repositories using yum repolist

      # yum repolist

15. To see all enabled and disabled yum repositories

       # yum repolist all

16. Install a package from specific repository

      # yum  --enablerepo=epel install firefox*

17. Which package does a file belong to? – Use yum provides

          # yum provides /etc/httpd/conf/httpd.conf

18. Clean yum chache using yum clean command


      # yum clean  all

19. To see History of Yum using yum history command

      # yum history

20. Update Server using yum

 One great feature about yum is that instead of updating a single package, you can list all updates that need to be installed for the system

       # yum list updates

From this list, you can choose to update packages individually or as a whole.If you want to install all(update entore system) using yum update command.

       # yum update

21. Execute yum commands interactively using Yum Shell

        Yum provides the interactive shell to run multiple commands as shown below.

        # yum shell

        Setting up yum shell 

         >info  zip
                  Display zip command information

        >install firefox
            Setting up Install Process

       >remove samba
             Setting up Remove Process

      >enter another command

you can work multiple commands at a time using yum shell.

1 comment:

  1. Nice , its help for all freshers on linux platform...


:: Linux - Legends ::