Show Menu
Cheatography

DNF package manager for Red Hat fam Linux systems. Cheat Sheet (DRAFT) by

Dnf is the default high-level package manager in the Red Hat family. It's the successor of Yum. Dnf is. modern and fast and have a lot of nice and convenient features to install, update, remove software.

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Reposi­tories

To print the list of all enabled reposi­tories
dnf repolist
show only enabled
dnf repolist enabled
disabled
dnf repolist disabled
all
dnf repolist all
show disabl­es/­enables
dnf install packag­e_name -disab­ler­epo=* --enab­ler­epo­=re­po_name
Enable­/di­sable
dnf config­-ma­nager --set-­dis­abled
List packages from repo
dnf reposi­tor­y-p­ackages fedora list
 
dnf reposi­tor­y-p­ackages fedora list available
 
dnf reposi­tor­y-p­ackages fedora list installed

Quick start - basic Usage of dnf

Search
dnf search packag­ename
Install
dnf install packag­ename
Remove
dnf remove packag­ename
Install group
dnf -y group install --with­-op­tional "­Dev­elo­pment Tools"
dnf can be used exactly as yum to search, install or remove packages.
See manual https:­//d­ocs.fe­dor­apr­oje­ct.o­rg­/en­-US­/qu­ick­-do­cs/dnf/
 

Groups

List available package groups
dnf group list
Info of group components
dnf -v group info virtua­liz­ation
List installed
dnf group list --inst­alled
Installing
dnf install @virtu­ali­zation
 
dnf group install virtua­liz­ation
 
dnf group install --with­-op­tional virtua­liz­ation
Upgrade
dnf group upgrade virtua­liz­ation
Removing
dnf group remove virtua­liz­ation
If we only want to obtain the list of all installed package groups, instead, we can use the --inst­alled option:
 

Options

Setting for disable install recomm­enden libs
dnf --seto­pt=­ins­tal­l_w­eak­_de­ps=­False

DNF config­-ma­nager

Help
dnf config­-ma­nager --help-cmd
Enable repo
dnf config­-ma­nager --set-­enabled <re­po>
Disable repo
dnf config­-ma­nager --set-­dis­abled <re­po>
Add repo
dnf config­-ma­nager --add-­rep­o=<­rep­o>

Removi­ng/­Cle­aning

Remove the named packages
dnf remove a_pack­age­_name
Removes a group, and its packages
dnf group remove a_grou­p_name
Removes old versions of packages
dnf remove --oldi­nst­allonly
Removes cached packages
dnf clean packages
Clean dbcache, metadata, cached # packages, and to expire reposi­tories meta data
dnf clean all

Removi­ng/­Cle­aning

Remove the named packages
dnf remove a_pack­age­_name
Removes a group, and its packages
dnf group remove a_grou­p_name
Removes old versions of packages
dnf remove --oldi­nst­allonly
Removes cached packages
dnf clean packages
Clean dbcache, metadata, cached # packages, and to expire reposi­tories meta data
dnf clean all