Installing and Removing Packages in Linux using Yum

To install/remove a package in linux using yum we have to use root or privilaged user.Package will install all the dependencies as well.


Install package
yum install <package name>

yum install zip


Only Download RPM

yum install --downloadonly --downloaddir=/tmp

Install from local rpm

yum localinstall  <rpm name>


Re-install a package

yum reinstall <package name>


Re-install while skipping a dependencies which is not available in repository

yum reinstall  --skip-broken <package name>

Upgrade a package

yum upgrade <package name>

Remove a package
It will only remove package and dont remove any dependency

yum remove <package name>

Remove package and its dependencies

yum autoremove <package name>