Package Management

Yum is a rpm based package manager used to query, fetch, install, remove and update packes within a Centos / RHEL system based on repository metadata. It also performs automatic dependency resolution on packages that are updated, installed or removed.

Commonly used Yum commands:

PACKAGE

  • Install a package
    • yum install <package-name>
    • yum install <name of the binary> ex: yum install /usr/sbin/named
    • yum searches through its package lists, finds the package which provides /usr/sbin/named, if any, and prompts you as to whether you want to install it.
  • Check availability updates for installed packages
    • yum check-update [All installed packages]
    • yum check-update <package-name>
  • Update installed packages
    • yum update [All packages]
    • yum update <package-name>
  • Updating kernel
    • Yum always installs a new kernel in the same sense that RPM installs a new kernel using ‘rpm -i kernel’
    • ‘rpm -u kernel’ – replaces the current kernel
  • Difference between ‘yum update’ and ‘yum upgrade’
    • ‘yum upgrade’ will forces the removal of obsolete packages, and is same as running ‘yum update –obsoletes’.
    • ‘yum update’ preserves obsolete packages if –obsoletes flag is not used.
  • Search for available packages : ‘yum search <package-name>
    • ‘yum search’ returns matches in package name and summary and is faster
    • ‘yum search all’ is more exhaustive and slower search
  • Find packages that contain file-name
    • yum provides “*/file-name”
  • List all Installed and Available packages
    • ‘yum list all’ or ‘yum list <package-name>’
    • List Installed packages only – ‘yum list installed <package-name>’
    • List Available packages only – ‘yum list available <package-name>’
  • Display detailed information about a package
    • ‘yum info <package-name>
  • Display dependencies of a package
    • yum deplist <package-name>
  • ‘yumdb’ – Yum Database provides additional information about packages like checksum, dependencies, user that installed it
    • ‘yumdb’ is not installed by default. To make this command available, first install the ‘yum-utils’ package.
    • yum install yum-utils
    • yumdb info <package-name>
  • Remove a package
    • yum remove <package-name> [Does not remove dependent packages]

REPOSITORY

  • List summary of enabled repositories
    • yum repolist
  • Detailed information about enabled repositories
    • yum repolist -v
    • yum repoinfo
  • List both enabled and disabled repositories
    • yum repolist all

PACKAGE GROUPS

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s