Package commands
List installed packages:
yum list installedor:
dnf list installedInstall 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-updateor:
dnf check-updateUpdate packages with newer versions:
yum upgradeor:
dnf upgradeInstall 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.0or:
dnf install <pkg>-1.0Install packages needed to build ‘pkg’ from source:
yum builddep <pkg>or:
dnf builddep <pkg>
Search
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>