Since Software management is an essential part of operating system management, for that, this article explains yum basics and the common command and options, as this package manager allows install, update, remove, or search for packages.
Common Linux distributions come with its package manager, for instance, Debian and Ubuntu use APT. on the other hand, Redhat, CentOS, OEL, and Fedora provide Yum and DNF as their package manager.
Yum vs DNF
DNF is the new major upgrade of Yum, It’s short for Dandified YUM and It became the default Package manager in Fedora, CentOS 8, RHEL 8. besides all features DNF brings to the os, It has the same syntax as yum.
The main syntax as described in this pic : yum [options] [command] [package …]
To utilize Linux package managers, like yum or DNF. you should be a privileged account “root”.
Though, man provide rich documentation for yum, it has too much information that confuses the reader. for that, This article will focus on the most used one
The following yum command used to manipulate packages.
|Search package details for the given string.
|List a package or group of packages. for example:
yum list htop
|Install a package or packages on your system.
|Update a package or packages on your system.
|Remove a package or group of packages from your system.
DNF repository management.
|Display the configured software repositories. also, you can append the following option to control its output:
all –> show all repositories in the systems.
disabled –> show only disabled repositories.
enabled –> show only enabled repositories it, it’s same as using repolist without any options.
Yum Maintenace & troubleshooting
|Check for problems in the rpmdb.
|Remove cached data and free space. You need to append one of the following values to the command:
|Check for available package updates.
Options for YUM or DNF.
|Resolve to IPv4 addresses only. besides, you can use -6 to resolve using IPv4 addresses.
|Disable specific repositories by an id or a name. also, This option is mutually exclusive with –repo.
|Download the resolved package without performing any rpm transaction, for example, install, upgrade, or erase package.
|Enable additional repositories by an id or a global name. besides the currently available packages.
|Allow erasing of installed packages to resolve dependencies.
|Try the best available package versions, Specifically, during dnf upgrade operation.
|Include packages that will improve the main package features. Applicable for the install, repoquery updateinfo, and upgrade commands.
|Automatically answer yes for all questions.
if you want to enable autocomplete for yum and DNF, Install python and bash-auto complete packages.
sudo dnf -y install python sudo yum -y install bash-completion bash-completion-extras
To conclude, These were the most used options and commands for yum command. however, it has many other features this article does not cover.