English French
[application]*DNF* is the {OSORG} package manager that is able to query for information about packages, fetch packages from repositories, install and uninstall packages using automatic dependency resolution, and update an entire system to the latest available packages. DNF performs automatic dependency resolution on packages you are updating, installing or removing, and thus is able to automatically determine, fetch and install all available dependent packages. DNF can be configured with new, additional repositories, or _package sources_, and also provides many plug-ins which enhance and extend its capabilities. DNF is able to perform many of the same tasks that [application]*RPM* can; additionally, many of the command line options are similar. DNF enables easy and simple package management on a single machine or on groups of them.
Secure package management with GPG-signed packages
DNF provides secure package management by enabling GPG (Gnu Privacy Guard; also known as GnuPG) signature verification on GPG-signed packages to be turned on for all package repositories (package sources), or for individual repositories. When signature verification is enabled, DNF will refuse to install any packages not GPG-signed with the correct key for that repository. This means that you can trust that the [application]*RPM* packages you download and install on your system are from a trusted source, such as {OSORG}, and were not modified during transfer. See xref:DNF.adoc#sec-Configuring_DNF_and_DNF_Repositories[Configuring DNF and DNF Repositories] for details on enabling signature-checking with DNF, or xref:RPM.adoc#s1-check-rpm-sig[Checking Package Signatures] for information on working with and verifying GPG-signed [application]*RPM* packages in general.
DNF also enables you to easily set up your own repositories of [application]*RPM* packages for download and installation on other machines.
Learning DNF is a worthwhile investment because it is often the fastest way to perform system administration tasks, and it provides capabilities beyond those provided by the [application]*PackageKit* graphical package management tools.
DNF and superuser privileges
You must have superuser privileges in order to use the [command]#dnf# command to install, update or remove packages on your system. All examples in this chapter assume that you have already obtained superuser privileges by using either the [command]#su# or [command]#sudo# command.
Checking For and Updating Packages
Checking For Updates
indexterm:[DNF Updates,checking for updates] The quickest way to check for updates is to attempt to install any available updates by using the [command]#dnf upgrade# command as follows:
~]# dnf upgrade
Last metadata expiration check performed 1:24:32 ago on Thu May 14 23:23:51 2015.
Dependencies resolved.
Nothing to do.
Note that [command]#dnf upgrade# installs only those updates that can be installed. If a package cannot be updated, because of dependency problems for example, it is skipped.
The [command]#dnf check-update# command can be used see which installed packages on your system have new versions available, however it does not mean that they can be successfully installed. This command is therefore mostly useful in scripts and for checking for updated packages that were not installed after running [command]#dnf upgrade#.
For example:
~]# dnf check-update
Using metadata from Mon Apr 20 16:34:10 2015 (2:42:10 hours old)
python.x86_64 2.7.9-6.fc22 updates
python-cryptography.x86_64 0.8.2-1.fc22 updates
python-libs.x86_64 2.7.9-6.fc22 updates
The packages in the above output are listed as having updated versions. The line in the example output tells us:
`python` — the name of the package,
`x86_64` — the CPU architecture the package was built for,