DNF Commands

DNF Command Examples

What is DNF?


DNF (Dandified Yum) is the next generation of the yum (Yellowdog Update Modified) package manager. DNF was created as an improvement to the yum package manager, addressing performance, memory and dependency resolution issues. It is intended that DNF will eventually replace the yum package manager that is currently found on RPM based systems. DNF was first introduced in Fedora 18 and is now the default package manager for Fedora 25.


DNF Command Examples


Below are some examples of using DNF to install, remove, update packages on your Linux system. Examples below were all carried out on a Fedora Linux Server.



Display DNF Version


Basic Syntax: dnf --version



[root@fedora22srv ~]# dnf --version
1.0.0
  Installed: dnf-0:1.0.0-1.fc22.noarch at 2015-10-25 23:16
  Built    : Fedora Project at 2015-05-02 13:00

  Installed: rpm-0:4.12.0.1-9.fc22.x86_64 at 2015-10-25 23:15
  Built    : Fedora Project at 2015-04-15 09:21

The above command is used to display the currently installed version of DNF.


Displaying Repositories - dnf repolist


Basic Syntax: dnf repolist



[root@fedora22srv ~]# dnf repolist

Last metadata expiration check performed 0:00:49 ago on Tue Oct 27 10:10:09 2015.
repo id                    repo name                                       status
*fedora                    Fedora 22 - x86_64                              44,762
*updates                   Fedora 22 - x86_64 - Updates                    16,035

The command "dnf repolist" will display all enabled repositories. You may pass an additional parameter of "all" to display enabled and disabled repositories.


Listing Installed Packages - dnf list installed


Basic Syntax: dnf list installed



[john@fedora22srv ~]$ dnf list installed

Last metadata expiration check performed 0:04:23 ago on Tue Oct 27 10:10:09 2015.
Installed Packages
NetworkManager.x86_64                   1:1.0.2-1.fc22                   @System
NetworkManager-libnm.x86_64             1:1.0.2-1.fc22                   @System
PackageKit.x86_64                       1.0.6-4.fc22                     @System
PackageKit-glib.x86_64                  1.0.6-4.fc22                     @System
aajohan-comfortaa-fonts.noarch          2.004-4.fc22                     @System
abrt.x86_64                             2.5.1-2.fc22                     @System
abrt-addon-ccpp.x86_64                  2.5.1-2.fc22                     @System
abrt-addon-coredump-helper.x86_64       2.5.1-2.fc22                     @System
abrt-addon-kerneloops.x86_64            2.5.1-2.fc22                     @System
abrt-addon-pstoreoops.x86_64            2.5.1-2.fc22                     @System
abrt-addon-python.x86_64                2.5.1-2.fc22                     @System

This command will display all installed packages on your system. The above output is only an extract of the information displayed.

Displaying Available and Installed packages - dnf list


Basic Syntax: dnf list



[john@fedora22srv ~]$ dnf list 

Last metadata expiration check performed 0:07:21 ago on Tue Oct 27 10:10:09 2015.
Installed Packages
NetworkManager.x86_64                    1:1.0.2-1.fc22                  @System
NetworkManager-libnm.x86_64              1:1.0.2-1.fc22                  @System
PackageKit.x86_64                        1.0.6-4.fc22                    @System
PackageKit-glib.x86_64                   1.0.6-4.fc22                    @System
aajohan-comfortaa-fonts.noarch           2.004-4.fc22                    @System
abrt.x86_64                              2.5.1-2.fc22                    @System
Available Packages
zsh.x86_64                               5.0.8-5.fc22                    updates
zsh-html.x86_64                          5.0.8-5.fc22                    updates
zsh-lovers.noarch                        0.9.0-1.fc21                    fedora
zukitwo-common.noarch                    20141022-10.fc22                updates
zukitwo-gtk2-theme.noarch                20141022-10.fc22                updates
zukitwo-gtk3-theme.noarch                20141022-10.fc22                updates
zukitwo-metacity-theme.noarch            20141022-10.fc22                updates
zukitwo-xfwm4-theme.noarch               20141022-10.fc22                updates

In the above example, we can see both "Installed Packages" and "Available Packages". (The above output is an extract of the full output).



Display Available packages only - dnf list available


Basic Syntax: dnf list available



[root@fedora22srv ~]# dnf list available

Last metadata expiration check performed 0:12:53 ago on Tue Oct 27 10:10:09 2015.
Available Packages
0ad.x86_64                               0.0.18-1.fc22                   fedora
0ad-data.noarch                          0.0.18-1.fc22                   fedora
0install.x86_64                          2.10-2.fc22                     updates
0xFFFF.x86_64                            0.3.9-11.fc22                   fedora
2048-cli.x86_64                          0.9-4.git20141214.723738c.fc22  fedora
2048-cli-nocurses.x86_64                 0.9-4.git20141214.723738c.fc22  fedora

In the above example we used the "dnf list available" command to list only available packages.


Display Package Information - dnf info


Basic Syntax: dnf info package name


[root@fedora22srv ~]# dnf info htop

Last metadata expiration check performed 0:41:34 ago on Tue Oct 27 09:51:50 2015.
Available Packages
Name        : htop
Arch        : x86_64
Epoch       : 0
Version     : 1.0.3
Release     : 4.fc22
Size        : 91 k
Repo        : fedora
Summary     : Interactive process viewer
URL         : http://hisham.hm/htop/
License     : GPL+
Description : htop is an interactive text-mode process viewer for Linux, similar
            : to top(1).

The above command displays information about the specified package. Release/version and architecture information is given along with a handy link to the package website.




Searching for a package - dnf search


Basic Syntax: dnf search pattern



[john@fedora22srv tmp]$ dnf search htop

Last metadata expiration check performed 0:15:46 ago on Tue Oct 27 10:10:09 2015.
=============================== N/S Matched: htop ===============================
htop.x86_64 : Interactive process viewer
php-lightopenid.noarch : PHP OpenID library

In the above example we searched for any packages that contained the pattern "htop". This option is useful if you do not know the full name of the package. This option searches package metadata for the specified keywords.


dnf provides


Basic Syntax: dnf provides provide-spec

Displays what package provides the specified file.



[root@fedora22srv ~]# dnf provides htop

Last metadata expiration check performed 0:40:19 ago on Tue Oct 27 09:51:50 2015.
htop-1.0.3-4.fc22.x86_64 : Interactive process viewer
Repo        : fedora

Installing Packages - dnf install


Basic Syntax: dnf install package name

The "dnf install" command is used to install the specified package. Any dependencies are displayed and then installed for the specified package.



[root@fedora22srv ~]# dnf install htop
Last metadata expiration check performed 0:44:44 ago on Tue Oct 27 09:51:50 2015.
Dependencies resolved.
=================================================================================
 Package        Arch             Version                  Repository        Size
=================================================================================
Installing:
 htop           x86_64           1.0.3-4.fc22             fedora            91 k

Transaction Summary
=================================================================================
Install  1 Package

Total download size: 91 k
Installed size: 180 k
Is this ok [y/N]: y
Downloading Packages:
htop-1.0.3-4.fc22.x86_64.rpm                     659 kB/s |  91 kB     00:00    
---------------------------------------------------------------------------------
Total                                             65 kB/s |  91 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Installing  : htop-1.0.3-4.fc22.x86_64                                     1/1 
  Verifying   : htop-1.0.3-4.fc22.x86_64                                     1/1 

Installed:
  htop.x86_64 1.0.3-4.fc22                                                       

Complete!

Reinstalling a Package - dnf reinstall


Basic Syntax: dnf reinstall package name

The "dnf reinstall" command is used to reinstall the specified package.



[root@fedora22srv ~]# dnf reinstall htop

Last metadata expiration check performed 0:06:19 ago on Tue Oct 27 11:18:12 2015.
Dependencies resolved.
=================================================================================
 Package        Arch             Version                  Repository        Size
=================================================================================
Reinstalling:
 htop           x86_64           1.0.3-4.fc22             fedora            91 k

Transaction Summary
=================================================================================

Total download size: 91 k
Is this ok [y/N]: y
Downloading Packages:
htop-1.0.3-4.fc22.x86_64.rpm                     455 kB/s |  91 kB     00:00    
---------------------------------------------------------------------------------
Total                                             75 kB/s |  91 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Reinstalling: htop-1.0.3-4.fc22.x86_64                                     1/2 
  Erasing     : htop-1.0.3-4.fc22.x86_64                                     2/2 
  Verifying   : htop-1.0.3-4.fc22.x86_64                                     1/2 
  Verifying   : htop-1.0.3-4.fc22.x86_64                                     2/2 

Reinstalled:
  htop.x86_64 1.0.3-4.fc22                                                       

Complete!

Updating specific packages - dnf update


Basic Syntax: dnf update package name

The "dnf update" command is used to update specific packages. Before using the update option, it is useful to check the current version of the package and check to see whether a newer version is available. To do this we use the "dnf list" command to show the currently installed version and any versions that are available.



[root@fedora22srv ~]# dnf list zip.x86_64

Last metadata expiration check performed 0:46:26 ago on Tue Oct 27 09:51:50 2015.
Installed Packages
zip.x86_64                          3.0-13.fc22                           @System
Available Packages
zip.x86_64                          3.0-14.fc22                           updates

From the above output we can see that the package "zip.X86_64" is at version "3.0-13.fc22" and an updated version "3.0-14.fc22" is available. To update this package, we use the "dnf update" command:



[root@fedora22srv ~]# dnf update zip.x86_64
Last metadata expiration check performed 0:49:37 ago on Tue Oct 27 09:51:50 2015.
Dependencies resolved.
=================================================================================
 Package       Arch             Version                  Repository         Size
=================================================================================
Upgrading:
 zip           x86_64           3.0-14.fc22              updates           267 k

Transaction Summary
=================================================================================
Upgrade  1 Package

Total download size: 267 k
Is this ok [y/N]: y
Downloading Packages:
zip-3.0-14.fc22.x86_64.rpm                       951 kB/s | 267 kB     00:00    
---------------------------------------------------------------------------------
Total                                            163 kB/s | 267 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Upgrading   : zip-3.0-14.fc22.x86_64                                       1/2 
  Cleanup     : zip-3.0-13.fc22.x86_64                                       2/2 
  Verifying   : zip-3.0-14.fc22.x86_64                                       1/2 
  Verifying   : zip-3.0-13.fc22.x86_64                                       2/2 

Upgraded:
  zip.x86_64 3.0-14.fc22                                                         

Complete!

Downgrading a Package - dnf downgrade


Basic Syntax: dnf downgrade package name

The "dnf downgrade" command is used to downgrade the specified packages to the highest of all known lower versions if possible. In the following example, we will downgrade the previously updated package "zip.x86_64". To establish the current version of the package we used the command "dnf list".



[root@fedora22srv ~]# dnf list zip.x86_64
Last metadata expiration check performed 0:10:01 ago on Tue Oct 27 11:18:12 2015.
Installed Packages
zip.x86_64                          3.0-14.fc22                          @updates


[root@fedora22srv ~]# dnf downgrade zip.x86_64

Last metadata expiration check performed 0:10:10 ago on Tue Oct 27 11:18:12 2015.
Dependencies resolved.
=================================================================================
 Package        Arch              Version                Repository         Size
=================================================================================
Downgrading:
 zip            x86_64            3.0-13.fc22            fedora            267 k

Transaction Summary
=================================================================================
Downgrade  1 Package

Total download size: 267 k
Is this ok [y/N]: y
Downloading Packages:
zip-3.0-13.fc22.x86_64.rpm                       843 kB/s | 267 kB     00:00    
---------------------------------------------------------------------------------
Total                                            252 kB/s | 267 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Downgrading : zip-3.0-13.fc22.x86_64                                       1/2 
  Erasing     : zip-3.0-14.fc22.x86_64                                       2/2 
  Verifying   : zip-3.0-13.fc22.x86_64                                       1/2 
  Verifying   : zip-3.0-14.fc22.x86_64                                       2/2 

Downgraded:
  zip.x86_64 3.0-13.fc22                                                         

Complete!

Removing a Package - dnf remove


Basic Syntax: dnf remove package name

The "dnf remove" command is used to remove a specified package. You may also use the "erase" option, however, "erase" has now been deprecated.



[root@fedora22srv ~]# dnf remove htop
Dependencies resolved.
=================================================================================
 Package        Arch             Version                 Repository         Size
=================================================================================
Removing:
 htop           x86_64           1.0.3-4.fc22            @System           180 k

Transaction Summary
=================================================================================
Remove  1 Package

Installed size: 180 k
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Erasing     : htop-1.0.3-4.fc22.x86_64                                     1/1 
  Verifying   : htop-1.0.3-4.fc22.x86_64                                     1/1 

Removed:
  htop.x86_64 1.0.3-4.fc22                                                       

Complete!

Checking for system updates - dnf check-update


Basic Syntax: dnf check-update

The "dnf check-update" command is used to check for available updates on your Linux system. The "check-update" checks for any available updates of the specified packages. If no package name(s) are given then it will check for all updates available to your system. (Below is a small extract from the "dnf check-update" command).



[[root@fedora22srv ~]# dnf check-update

Last metadata expiration check performed 0:54:40 ago on Tue Oct 27 09:51:50 2015.

NetworkManager.x86_64                  1:1.0.6-6.fc22                     updates
NetworkManager-libnm.x86_64            1:1.0.6-6.fc22                     updates
PackageKit.x86_64                      1.0.10-1.fc22                      updates
PackageKit-glib.x86_64                 1.0.10-1.fc22                      updates
abrt.x86_64                            2.6.1-5.fc22                       updates

Listing Available Updates - dnf list updates


Basic Syntax: dnf list updates

The "dnf list updates" command is used to list any available updates available to your system. Can be used as an alternative to the above "check-update" command. (Below is a small extract from the output).



Last metadata expiration check performed 0:56:17 ago on Tue Oct 27 09:51:50 2015.
Upgraded Packages
NetworkManager.x86_64                  1:1.0.6-6.fc22                     updates
NetworkManager-libnm.x86_64            1:1.0.6-6.fc22                     updates
PackageKit.x86_64                      1.0.10-1.fc22                      updates
PackageKit-glib.x86_64                 1.0.10-1.fc22                      updates
abrt.x86_64                            2.6.1-5.fc22                       updates
abrt-addon-ccpp.x86_64                 2.6.1-5.fc22                       updates

Update all Packages - dnf update


Basic Syntax: dnf update

The "dnf update" command is used to update all packages on your system. Individual packages may be specified. Where no packages are specified, all packages will be updated providing newer packages are available. (Below is a small extract of output from the "update" command.



[root@fedora22srv ~]# dnf update

Last metadata expiration check performed 0:58:50 ago on Tue Oct 27 09:51:50 2015.
Dependencies resolved.
================================================================================
 Package                      Arch   Version                      Repository
                                                                           Size
================================================================================
Installing:
 abrt-dbus                    x86_64 2.6.1-5.fc22                 updates 127 k
 audit-libs-python            x86_64 2.4.4-1.fc22                 updates  96 k
 checkpolicy                  x86_64 2.3-4.fc22                   fedora  260 k
 dnf-langpacks-conf           noarch 0.15.1-1.fc22                updates  12 k
 tcpdump                      x86_64 14:4.7.4-2.fc22              updates 407 k
 tzdata                       noarch 2015g-1.fc22                 updates 422 k
 uboot-tools                  x86_64 2015.07-5.fc22               updates 271 k
 udisks2                      x86_64 2.1.6-1.fc22                 updates 333 k
 unzip                        x86_64 6.0-22.fc22                  updates 174 k
 util-linux                   x86_64 2.26.2-3.fc22                updates 2.0 M
 vim-minimal                  x86_64 2:7.4.827-1.fc22             updates 465 k
 xdg-utils                    noarch 1.1.1-1.fc22                 updates  82 k
 xfsprogs                     x86_64 3.2.2-2.fc22                 updates 873 k

Transaction Summary
================================================================================
Install   22 Packages
Upgrade  306 Packages

Total download size: 227 M
Is this ok [y/N]:y

Tidying Up - dnf autoremove


Basic Syntax: dnf autoremove

The "dnf autoremove" command is used to removes all "leaf" packages from the your system that were originally installed as dependencies of user-installed packages but which are no longer required by any such package. Any packages that can be removed will be displayed. You will be required to confirm the removal of the packages.



[root@fedora22srv ~]# dnf autoremove
Last metadata expiration check performed 1:52:57 ago on Tue Oct 27 11:18:12 2015.
Dependencies resolved.
=================================================================================
 Package                   Arch     Version                    Repository   Size
=================================================================================
Removing:
 aajohan-comfortaa-fonts   noarch   2.004-4.fc22               @anaconda   515 k
 cairo                     x86_64   1.14.2-1.fc22              @anaconda   1.7 M
 cairo-gobject             x86_64   1.14.2-1.fc22              @anaconda    35 k
 fontconfig                x86_64   2.11.94-4.fc22             @updates    604 k
 fontpackages-filesystem   noarch   1.44-12.fc22               @updates      0  
 libXdamage                x86_64   1.1.4-6.fc22               @anaconda    29 k
 libXext                   x86_64   1.3.3-2.fc22               @anaconda    84 k
 libXfixes                 x86_64   5.0.1-4.fc22               @anaconda    26 k
 libXrender                x86_64   0.9.9-1.fc22               @anaconda    42 k
 libXxf86vm                x86_64   1.1.4-1.fc22               @anaconda    25 k
 libwayland-client         x86_64   1.7.0-1.fc22               @anaconda    57 k
 libwayland-server         x86_64   1.7.0-1.fc22               @anaconda    73 k
 libxshmfence              x86_64   1.2-1.fc22                 @anaconda    11 k
 mesa-libEGL               x86_64   10.6.9-1.20151008.fc22     @updates    186 k
 mesa-libGL                x86_64   10.6.9-1.20151008.fc22     @updates    640 k
 mesa-libgbm               x86_64   10.6.9-1.20151008.fc22     @updates     82 k
 mesa-libglapi             x86_64   10.6.9-1.20151008.fc22     @updates    187 k
 pycairo                   x86_64   1.10.0-1.fc22              @anaconda   1.0 M
 pygobject2                x86_64   2.28.6-13.fc22             @anaconda   877 k
 pygobject3                x86_64   3.16.2-1.fc22              @updates     15 k
 python-chardet            noarch   2.2.1-2.fc22               @anaconda   1.1 M
 python-requests           noarch   2.7.0-7.fc22               @updates    344 k
 python-urllib3            noarch   1.10.4-6.fc22              @updates    380 k
 python-xpyb               x86_64   1.3.1-4.fc22               @anaconda   1.2 M

Transaction Summary
=================================================================================
Remove  24 Packages

Installed size: 9.2 M
Is this ok [y/N]: 

Working with Package Groups - dnf grouplist


Many packages are grouped together into convenient groups. This allows a system administrator to install a group of packages with one single command. The command "dnf grouplist" can be used to display available groups on your system. (Below is an extract of the "grouplist" command).



[root@fedora22srv ~]# dnf group list

Last metadata expiration check performed 0:12:24 ago on Tue Oct 27 11:18:12 2015.
Available environment groups:
   Minimal Install
   Fedora Server
   Fedora Workstation
   Fedora Cloud Server
   KDE Plasma Workspaces
   Xfce Desktop
   LXDE Desktop
   LXQt Desktop
   Cinnamon Desktop
   MATE Desktop
   Sugar Desktop Environment
   Development and Creative Workstation
   Web Server
   Infrastructure Server
   Basic Desktop
Available groups:
   3D Printing
   Administration Tools
   Audio Production
   Authoring and Publishing
   Books and Guides
   C Development Tools and Libraries
   Cloud Infrastructure
   Cloud Management Tools
   Container Management
   D Development Tools and Libraries
   Design Suite
   Development Tools
   Domain Membership
   Fedora Eclipse
   Editors
  

Install a Group of Packages - dnf groupinstall groupname


In the example below we are going to install numerous editing tools that are available. To install all the available "Editors" we issue the command "dnf groupinstall Editors". (Please note, if the group package contains spaces within its name, then you must place single quotes around the group name.)



[root@fedora22srv ~]# dnf groupinstall Editors

Last metadata expiration check performed 0:13:54 ago on Tue Oct 27 11:18:12 2015.
Dependencies resolved.
=================================================================================
 Group          Packages                                                       
=================================================================================
Marking installed:
 Editors        xemacs-packages-extra      nedit                     zile      
                xmlcopyeditor              emacs-bbdb                geany     
                emacs-ess                  emacs                     jed       
                psgml                      code-editor               emacs-vm  
                emacs-muse                 gobby                     leafpad   
                joe                        cssed                     vim-X11   
                vim-enhanced               xemacs-xft                xemacs-ess
                xemacs                     xemacs-packages-base      poedit    
                emacs-auctex               xemacs-muse                         
Is this ok [y/N]: y
Complete!
  

Update a Group of Packages - dnf groupupdate groupname


In the example below we are going to update all packages within the group "Editors". In this example, no updates were currently available.



[root@fedora22srv ~]# dnf groupupdate Editors

Last metadata expiration check performed 2:47:21 ago on Tue Oct 27 11:18:12 2015.
Group 'Editors' is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

  

Remove a Group of Packages - dnf groupremove groupname


In the example below we are going to remove a group. To remove the group "Editors", the command "dnf groupremove Editors" is used. (Please note, if the group package contains spaces within its name, then you must place single quotes around the group name).



[root@fedora22srv ~]# dnf groupremove Editors

Last metadata expiration check performed 0:18:34 ago on Tue Oct 27 11:18:12 2015.
Dependencies resolved.
=================================================================================
 Group          Packages                                                       
=================================================================================
Marking removed:
 Editors        xemacs-packages-extra      nedit                     zile      
                xmlcopyeditor              emacs-bbdb                geany     
                emacs-ess                  emacs                     jed       
                psgml                      code-editor               emacs-vm  
                emacs-muse                 gobby                     leafpad   
                joe                        cssed                     vim-X11   
                vim-enhanced               xemacs-xft                xemacs-ess
                xemacs                     xemacs-packages-base      poedit    
                emacs-auctex               xemacs-muse                         
Is this ok [y/N]: y
Complete!
  

Synchronise All Packages - dnf distro-sync


"dnf distro-sync" will upgrade or downgrade all packages to the latest versions that are available from any enabled repository.



[root@fedora22srv ~]# dnf distro-sync
Last metadata expiration check performed 0:23:39 ago on Tue Oct 27 11:18:12 2015.
Dependencies resolved.
=================================================================================
 Package       Arch             Version                  Repository         Size
=================================================================================
Upgrading:
 zip           x86_64           3.0-14.fc22              updates           267 k

Transaction Summary
=================================================================================
Upgrade  1 Package

Total download size: 267 k
Is this ok [y/N]: y
Downloading Packages:
zip-3.0-14.fc22.x86_64.rpm                       703 kB/s | 267 kB     00:00    
---------------------------------------------------------------------------------
Total                                            187 kB/s | 267 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Upgrading   : zip-3.0-14.fc22.x86_64                                       1/2 
  Cleanup     : zip-3.0-13.fc22.x86_64                                       2/2 
  Verifying   : zip-3.0-14.fc22.x86_64                                       1/2 
  Verifying   : zip-3.0-13.fc22.x86_64                                       2/2 

Upgraded:
  zip.x86_64 3.0-14.fc22                                                         

Complete!
  

Clean temporary Files - dnf clean


Basic Syntax: dnf clean option

The "dnf clean" command is used to perform a cleanup of temporary files for any currently enabled repositories on your Linux system. Various options are available to carry out specific functions. "dnf clean all" will carry out all of the options.

dnf clean dbcache
Removes cache files generated from the repository metadata. This forces DNF to regenerate the cache files the next time it is run.

dnf clean expire-cache
Removes local cookie files saying when the metadata and mirrorlists were downloaded for each repo. DNF will re-validate the cache for each repo the next time it is used.

dnf clean metadata
Removes repository metadata. Those are the files which DNF uses to determine the remote availability of packages. Using this option will make DNF download all the metadata the next time it is run.

dnf clean packages
Removes any cached packages from the system.

dnf clean plugins
Tells all enabled plugins to eliminate their cached data.

dnf clean all
Carries out all of the above.



[root@fedora22srv ~]# dnf clean all

Cleaning repos: fedora updates
Cleaning up Everything

Displaying Transaction History


Basic Syntax: dnf history

The "dnf history" command is used to display transactions that have happened in the past.



[root@fedora22srv ~]# dnf history

Last metadata expiration check performed 2:52:46 ago on Tue Oct 27 11:18:12 2015.
ID     | Command line             | Date a | Action | Altere
-------------------------------------------------------------------------------
    13 | autoremove               | 2015-10-27 13:11 | Erase          |   24   
    12 | distro-sync              | 2015-10-27 11:42 | Update         |    1   
    11 | downgrade zip.x86_64     | 2015-10-27 11:28 | Downgrade      |    1   
    10 | remove htop              | 2015-10-27 11:25 | Erase          |    1   
     9 | reinstall htop           | 2015-10-27 11:24 | Reinstall      |    1   
     8 | install htop             | 2015-10-27 11:24 | Install        |    1   
     7 | update                   | 2015-10-27 11:10 | I, O, U        |  336   
     6 | remove htop              | 2015-10-27 11:00 | Erase          |    1   
     5 | update zip.x86_64        | 2015-10-27 10:41 | Update         |    1   
     4 | install htop             | 2015-10-27 10:36 | Install        |    1   
     3 | remove htop              | 2015-10-27 10:36 | Erase          |    1   
     2 | install htop             | 2015-10-27 10:36 | Install        |    1   
     1 |                          | 2015-10-25 23:14 | Install        |  658 EE

Getting Help with DNF


Basic Syntax: dnf help command

The "dnf help" command is used to display a list of available commands. You may also specify a command after the "help" option to display specific information. Below are some examples of the "dnf help" command in use. For full details of the options available to the "dnf" command, you can consult the man pages for dnf by issuing the command "man dnf". Another useful command is "man yum2dnf". This man page displays the differences between the "yum" package manager and "dnf".



[root@fedora22srv ~]# dnf help install
install PACKAGE...

Install a package or packages on your system


[root@fedora22srv ~]# dnf help remove
remove PACKAGE...

Remove a package or packages from your system

alias: erase


[root@fedora22srv ~]# dnf help list
list [PACKAGE|all|available|installed|updates|extras|autoremove|obsoletes|recent]

List a package or groups of packages
[root@fedora22srv ~]# dnf help update
upgrade [PACKAGE...]

Upgrade a package or packages on your system

alias: update