5. Installing Packages with YUM

The new and easy way

YUM (Yellowdog Update Modified) is the most efficient software package manager for a Red Hat based Linux distribution. The biggest use of this is it takes care of the package dependencies.

Repository: A repository a location whether local or remote location from which your system retrieves and installs OS updates and applications from. /etc/yum.repos.d/

Check all the repos in your system whether enabled or disabled

yum repolist all

List of all the repos on the system

Search for a Package

yum search nmap => searching for a package for nmap

Searching for package called 'player' in the repo.

After getting a bunch of packages, you can also get more information about any of them by yum info package-name command:

Getting info about a package

Installing a package

Unlike RPM, YUM checks all the dependencies and does the heavy work for you.

yum install -y package-name or yum install package-name

Removing a package

yum erase package-name or yum remove package-name

Note: Removing a package doesn't remove the dependencies that got installed with the package. You need to do it separately by: yum autoremove

sudo apt autoremove => For Ubuntu or Debian based system which removes all the unused dependencies.

List all the installed packages

yum list installed

Check update

yum check-update | grep nmap => checks an update for a package.

yum update => updates all the packages. But be careful about updating all the packages in a production environment.

To see currently installed package version + check what is the latest available version, use: sudo yum --showduplicates list 'nmap.*'

In this case, the latest package is already installed

YUM Cheat Sheet: