In this article, you how to configure yum or dnf in RHEL 8. There are two repositories that have been added one for AppStream and the second is BaseOS. In RHEL 8 both app and base os repositories have been separated from each other.
In RHEL 8 default package manager is dnf and it is symlink with yum.
We will configure yum from the local iso but the procedure is the same from the FTP server too only need to change the baseurl path.
What is yum or dnf
If we want to install any package in Linux we can simply install it with the rpm command. But what will happen if the rpm package has dependencies and dependencies also have a dependency. This means for one package installation we have to install 5 other packages and those 5 packages have other 10 packages. If we use yum or dnf dependency part has been handled by these package managers. We have to just confirm that we want to install dependency with the required package.
Till RHEL 7 yum is the main package manager and in RHEL 8 REDHAT had introduced dnf as a package manager.
Difference Between YUM and DNF
There is some basic difference between yum and dnf.
- yum is written in only python while dnf in c,c++, and python
- dnf consume less memory than yum.
- If any repo is not available yum stop working but dnf skip that repo which is not available
- The main difference in RHEL 8 dnf or yum is they have separated BaseOS and APPStream which was in the same repo in RHEL 7.
- If you are a coder the dnf has half code of lines than yum.
These are some basic differences between yum and dnf. There are many more differences but this is a different topic.
How to configure yum(Yellow Dog Update Modifier) or dnf(Dandified Yum) in RHEL 8
1.Mount RHEL 8 DVD or iso to OS
Mount DVD by DVD reader.If you are using ESXi mount from local datastore in settings and In hypervisor mount from local drive.
2. Check mounted devices
Bonus Tip :
If you are working in a test environment and dnf is configured more than once or any other issue cause error in repolist or packaged installation.
Run below command :
# rm -r /var/cache/dnf
This will remove old cache and then run repolist and install packages.
Besides using a mounted DVD you can create a directory for yum or dnf and copy /mnt files to the created folder. This will reduce the risk of DVD unmount or corruption. If all packaged are at local installation will be faster.
Do not confuse if we are using repository in local then why not installed all packaged in OS installation time. For new users keep packaged local, only take your HDD space but install all package will consume CPU and RAM which reduce system or server performance.