Product SiteDocumentation Site

6.2.2. Listing Packages

dnf list and related commands provide information about packages, package groups, and repositories.
All of DNF's list commands allow you to filter the results by appending one or more glob expressions as arguments. Glob expressions are normal strings of characters which contain one or more of the wildcard characters * (which expands to match any character multiple times) and ? (which expands to match any one character).

Filtering results with glob expressions

Be careful to escape the glob expressions when passing them as arguments to a dnf command, otherwise the Bash shell will interpret these expressions as pathname expansions, and potentially pass all files in the current directory that match the globs to DNF. To make sure the glob expressions are passed to DNF as intended, either:
  • escape the wildcard characters by preceding them with a backslash character; or,
  • double-quote or single-quote the entire glob expression.
DNF searches only package names when using glob expressions. To search for a version of a package, include a dash and part of the version number as follows:
~]# dnf search kernel*-4*
Last metadata expiration check performed 2:46:09 ago on Thu May 14 23:23:51 2015.
Installed Packages
kernel.x86_64                        4.0.0-1.fc22                     @System
kernel.x86_64                        4.0.2-300.fc22                   @System
kernel-core.x86_64                   4.0.0-1.fc22                     @System
kernel-core.x86_64                   4.0.2-300.fc22                   @System
[output truncated]
dnf list glob_expression
Lists information on installed and available packages matching all glob expressions.
Example 6.1. Listing all ABRT addons and plug-ins using glob expressions
Packages with various ABRT addons and plug-ins either begin with abrt-addon-, or abrt-plugin-. To list these packages, type the following at a shell prompt:
~]# dnf list abrt-addon\* abrt-plugin\*
Last metadata expiration check performed 0:14:36 ago on Mon May 25 23:38:13 2015.
Installed Packages
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
abrt-addon-python3.x86_64               2.5.1-2.fc22               @System
abrt-addon-vmcore.x86_64                2.5.1-2.fc22               @System
abrt-addon-xorg.x86_64                  2.5.1-2.fc22               @System
abrt-plugin-bodhi.x86_64                2.5.1-2.fc22               @System
Available Packages
abrt-addon-upload-watch.x86_64          2.5.1-2.fc22               fedora

dnf list all
Lists all installed and available packages.
Example 6.2. Listing all installed and available packages
~]# dnf list all
Last metadata expiration check performed 0:21:11 ago on Mon May 25 23:38:13 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
[output truncated]

dnf list installed
Lists all packages installed on your system. The rightmost column in the output lists the repository from which the package was retrieved.
Example 6.3. Listing installed packages using a double-quoted glob expression
To list all installed packages that begin with krb followed by exactly one character and a hyphen, type:
~]# dnf list installed "krb?-*"
Last metadata expiration check performed 0:34:45 ago on Mon May 25 23:38:13 2015.
Installed Packages
krb5-libs.x86_64                        1.13.1-3.fc22              @System
krb5-workstation.x86_64                 1.13.1-3.fc22              @System

dnf list available
Lists all available packages in all enabled repositories.
Example 6.4. Listing available packages using a single glob expression with escaped wildcard characters
To list all available packages with names that contain gstreamer and then plugin, run the following command:
~]# dnf list available gstreamer\*plugin\*
Last metadata expiration check performed 0:42:15 ago on Mon May 25 23:38:13 2015.
Available Packages
gstreamer-plugin-crystalhd.i686              3.10.0-8.fc22          fedora
gstreamer-plugin-crystalhd.x86_64            3.10.0-8.fc22          fedora
gstreamer-plugins-bad-free.i686              0.10.23-24.fc22        fedora
gstreamer-plugins-bad-free.x86_64            0.10.23-24.fc22        fedora
gstreamer-plugins-bad-free-devel.i686        0.10.23-24.fc22        fedora
gstreamer-plugins-bad-free-devel.x86_64      0.10.23-24.fc22        fedora
 [output truncated]

dnf group list
Lists all package groups.
Example 6.5. Listing all package groups
~]# dnf group list
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Group Process
Installed Groups:
   Administration Tools
   Design Suite
   Dial-up Networking Support
   GNOME Desktop Environment
[output truncated]

dnf repolist
Lists the repository ID, name, and number of packages it provides for each enabled repository.
Example 6.6. Listing enabled repositories
~]# dnf repolist
Last metadata expiration check performed 0:48:29 ago on Mon May 25 23:38:13 2015.
repo id                             repo name                           status
*fedora                             Fedora 22 - x86_64                  44,762
*updates                            Fedora 22 - x86_64 - Updates             0

dnf repository-packages repo_id list
Lists the packages from the specified repository.
Example 6.7. Listing packages from a single repository
~]# dnf repository-packages fedora list [option]
Last metadata expiration check performed 1:38:25 ago on Wed May 20 22:16:16 2015.
Installed Packages
PackageKit.x86_64                        1.0.6-3.fc22                    @System
PackageKit-glib.x86_64                   1.0.6-3.fc22                    @System
aajohan-comfortaa-fonts.noarch           2.004-4.fc22                    @System
[output truncated]
The default action is to list all packages available and installed from the repository specified. Add the available or installed option to list only those packages available or installed from the specified repository.