Package Management

RPM
rpm (RPM Package Manager or Red Hat Package Manager) is really two things in one:
 * A package manager
 * A package

A package contains precompiled programs and information about the program it contains such as dependencies, version, and how the rpm program should install the package (such as where to install config files for the package).

A package manager is a program that reads the package and then figures out the proper installation options and configurations for the system on which the package is being installed. Most package managers automatically resolve - or at least mention - dependencies.

Note that rpm files come in several forms - some rpm files contain pre-compiled binaries, while some are source rpms. Source rpms need to have their binaries built and the package converted into a binary package in order to install the contained software in a fashion usable by the Fedora system.

Basic rpm querying
RPM, as a package manager, can be used to view information about installed packages - this information is part of what is included with the rpm file.

To query the rpm database for a list of all installed packages:
 * 1) rpm -qa

This will output all packages installed - for those unfamiliar with Linux systems, package managers, and rpm, this can be a lot of packages. To only display information about a particular package, use a pipe (|) in conjunction with the grep utility. For example, the following will show all packages matching the pattern "firefox":
 * 1) rpm -qa | grep firefox

To show files included with a package:
 * 1) rpm -ql

To show general information:
 * 1) rpm -qi

Installing, updating, and erasing packages with rpm
Installing packages with no output.
 * 1) rpm -i

Installing packages with a status bar.
 * 1) rpm -ivh

Uninstalling packages
 * 1) rpm -e

rpm can also be pointed to a specific ftp or http url to fetch the package from an online location and then install it immediately.
 * 1) rpm -ivh 

rpm can, further, be used to upgrade packages that have been previously installed, when a new version has been released.
 * 1) rpm -Uvh

To remove a package with rpm: Of course, be careful about what you are erasing.
 * 1) rpm -e

DNF
DNF, or Dandified Yum, is a package manager designed to use the rpm system to query, search, install, and uninstall packages using online public repositories. DNF can search and download the packages listed on the repositories it is configured to use - in the process downloading and installing necessary dependencies.

Usually, DNF is used to "fetch" and install packages from available public mirrors. Alternatively, one can set up local repositories that don't require an active internet connection.

DNF is Fedora's default package manager, which replaced yum in Fedora 22. DNF is used along with RPM to do the bulk of software management in Fedora. DNF can be run from the command line with simple syntax.

Basic DNF usage
This section covers the basics of using DNF with the assumption that you are using online mirrors and thus that you have an active Internet connection - preferably broadband; currently-supported Fedora releases can receive large amounts of updates in short periods of time - if you do not have a broadband connection, keeping Fedora updated at all times may not be a reasonable proposition. Installing only critical security updates (or other updates you really desire or need) can ease the load on your internet connection.

NB: third-party repository mixing should be done only with caution - specifically, Livna is not considered compatible with ATRPMs or Freshrpms.

DNF maintains a cache containing metadata and package information about enabled repositories. Sometimes, DNF will stop functioning properly. If DNF starts behaving strangly, the first two advised steps in troubleshooting are:
 * 1) Troubleshooting your connection to verify connectivity and the ability to contact mirrors
 * 2) Cleaning to DNF cache

The DNF cache can be cleared by issuing:
 * 1) dnf clean all

The basic syntax for installing packages with minimal required arguments is:
 * 1) dnf install

If you don't know the exact name of the package you would like to install, you can search the repositories using DNF from the command line.
 * 1) dnf search

Packages are removed using:
 * 1) dnf remove

Individual packages can be updated using the "update" argument:
 * 1) dnf update

Also, the entire system can be upgraded using a single command:
 * 1) dnf update

The -y option can be used to answer yes to all questions. This can be helpful when doing updates so you can set it and forget it. However, doing so could cause you to install an application you did not want. Use at your own risk; if in doubt, do not use the -y switch. It is especially not advised to use the -y switch in conjunction with DNF's remove functionality.
 * 1) dnf -y update

Installing more than one package is as simple as adding it to the end of the line.
 * 1) dnf install

In general, it is preferable to use DNF (or rpm) to add or remove software because this will allow you to automatically install and update your software
 * 1) without time-consuming compile jobs and
 * 2) allow you to cleanly and easily update your software, and its dependencies, when updates arrive in the repositories.