Manage Packages on RPM Linux Distros With DNF

 In this tutorial, How to install and remove packages on RPM-based Linux Distros with DNF.

DNF is the default package manager on Fedora and RHEL. when you run yum command on new Linux distros, it is actually using DNF in the background. Verify command below

ls -l /usr/bin/yum

The output the yum command is a symbolic link to dnf.

Search package with DNF

dnf search nginx
get more infomation abount a certain package
dnf info nginx

List all packages installed your system.
dnf list installed

Installing package use DNF

sudo dnf install nginx
How to view all the dependencies installed of nginx
dnf deplist nginx

Uninstall package use DNF

sudo dnf remove nginx
DNF keeps a record of all transactions that involve installing or removing software packages
dnf history

Removing Unused Dependencies

To remove such dependencies

sudo dnf autoremove

remove data downloaded along with installed packages.
sudo dnf clean packages

clean up your software package cache and other metadata that installed packages
sudo dnf clean metadata

Reinstalling Software Packages

sudo dnf reinstall nginx

Updating Packages With DNF

To fetch the latest software package updates from remote repositories

sudo dnf check-update
Update all installed software packages
sudo dnf update
You can also update a specific package
sudo dnf update nginx

No comments:

Post a Comment