2.6 Managing Software with DNF (dnf): A Comprehensive Guide

I'm Vijay Kumar Singh, a Linux, DevOps, Cloud enthusiast learner and contributor in shell scripting, Python, networking, Kubernetes, Terraform, Ansible, Jenkins, and cloud (Azure, GCP, AWS) and basics of IT world. 💻✨ Constantly exploring innovative IT technologies, sharing insights, and learning from the incredible Hashnode community. 🌟 On a mission to build robust solutions and make a positive impact in the tech world. 🚀 Let's connect and grow together!
#PowerToCloud
Managing software on a Linux system is a crucial task for system administrators and users alike. DNF (Dandified YUM) is a package manager used in Fedora and other RPM-based Linux distributions. In this guide, we'll explore various commands and operations to efficiently handle software using dnf.
Checking and Upgrading Software
Check for upgrades:
dnf check-upgradeUpgrade installed packages:
sudo dnf upgrade
Repository Management
Check repository list:
sudo dnf repolistor
sudo dnf repolist -vList all repositories (enabled and disabled):
sudo dnf repolist --allEnable/Disable a repository:
sudo dnf config-manager --enable repo_name sudo dnf config-manager --disable repo_nameAdd a new repository:
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repoRemove a repository:
sudo rm /etc/yum.repos.d/docker-ce.repo
Package Management
Search for packages:
sudo dnf search packageNameFor more accuracy:
sudo dnf search 'packageName'Get information about a package:
sudo dnf info packageNameInstall a package:
sudo dnf install packageNameReinstall a package:
sudo dnf reinstall packageNameUninstall or remove a package:
sudo dnf remove packageNameGroup Operations:
Install a group of packages:
sudo dnf group install 'packageName'List available groups:
sudo dnf group list sudo dnf group list --hiddenRemove a group of packages:
sudo dnf group remove 'packageName'
Local Package Operations
Install a local RPM file:
sudo dnf install ./packageName.rpmRemove a locally installed package:
sudo dnf remove packageName.rpm
Dependency Management
Remove unnecessary dependencies:
sudo dnf autoremove
File Management
Identify file origin (for troubleshooting):
dnf provides /etc/anacrontabAfter identifying an issue with a file (e.g., bad edits), reinstall the package:
sudo rm /etc/anacrontab dnf reinstall cronie-anacronView all files in a package (installed or not):
dnf repoquery -l packageName
This comprehensive guide should empower users and administrators to efficiently manage software on their Linux systems using the versatile dnf package manager.






