Skip to content

RPM Package Manager

Package commands

  • List installed packages:

      yum list installed

    or:

      dnf list installed
  • Install package ‘pkg.rpm’:

      rpm -i <pkg.rpm>

    or:

      dnf install <pkg.rpm>
  • Get name of installed package that contains ‘file’:

      rpm -qf <file>
  • List files of installed package ‘pkg’:

      rpm -ql <pkg>

Repository commands

  • Update list of available packages:

      yum check-update

    or:

      dnf check-update
  • Update packages with newer versions:

      yum upgrade

    or:

      dnf upgrade
  • Install package ‘pkg’:

      yum install <pkg>

    or:

      dnf install <pkg>
  • Reinstall package ‘pkg’:

      yum reinstall <pkg>

    or:

      dnf reinstall <pkg>
  • Uninstall package ‘pkg’:

      yum remove <pkg>

    or:

      dnf remove <pkg>
  • Install a specific version of package ‘pkg’:

      yum install <pkg>-1.0

    or:

      dnf install <pkg>-1.0
  • Install packages needed to build ‘pkg’ from source:

      yum builddep <pkg>

    or:

      dnf builddep <pkg>
  • Search packages whose name and description contains ‘string’:

      yum search all <string>

    or:

      dnf search all <string>
  • Search packages whose name contains ‘string’:

      yum search <string>

    or:

      dnf search <string>
  • Search packages that contain ‘file’:

      yum provides <file>

    or:

      dnf provides <file>
  • Show information about package ‘pkg’:

      yum info <pkg>

    or:

      dnf info <pkg>