Sunday, March 29, 2015

Yellodog Update Modifier – YUM helpful commands

Here I am giving you various yum command options in Linux OS, as we  all  System Administrators needs to deal with this command frequently. Lets take a quick look and be an expert !!  

1.     To install a package
#yum install packagename
#yum install packagename –y  [y – default yes for all the available packages]

2.     To uninstall a package
#yum remove packagename
{Its safe to remove rpm –e to remove the packages in my opinion}

3.     To upgrade a package
#yum upgrade packagename

4.     To search a package
#yum search packagename

5.     To display additional information about a package
#yum info packagename

6.     View all the available packages
#yum list |less

7.     To list only the installed packages
#yum list installed|less

8.     Which package does a file belong to? – Use yum provides
Ex: #yum provides /etc/sysconfig/nfs

9.     To list available software list in the group
#yum grouplist

10.To install a specific group
#yum groupinstall  ‘groupname’

11.To update an existing group
#yum groupupdate ‘groupname’

12.To uninstall a groupname
#yum groupremove ‘groupname’

13.To display the current repositories.
#yum repolist

14.To display all repositories
#yum repolist all

15.Install from a disabled repo
#yum –enablerepo=repositoryname install packagename

16.  To exclude a package using yum
#yum -x package1 update

17.  To exclude multiple packages using yum
#yum -x package1,package2 update

Also you can give an entry in /etc/yum.conf as  given below
exclude=package1,package2 --> with comma
or
exclude=package1 package2  ---> with space
You can also add the same in the individual repo file [ /etc/repos.d/package.repo]

18. Execute yum commands using YUM SHELL 

You can write the commands and save it in a file and execute it using Yum shell as given below













Hope it should help everyone , since all the admin may execute yum at least once in a day ...
Try it let me know if it helps :)

No comments:

Post a Comment

Thank you !!