Schnellreferenz zur DNF-Paketverwaltung

Peter Boy (pboy), Das Fedora-Dokumentationsteam Version F37 onwards Last review: 2023-08-29

Dieser Abschnitt listet die nützlichsten Befehle des Dienstprogramms dnf auf. Eine vollständige Liste der Befehle, Optionen und ihrer Syntax finden Sie in der Handbuchseite dnf(8).

dnf help Befehl

Zeigt detaillierte Informationen zu einem Befehl an.

$ dnf help upgrade
upgrade [PAKET...]

Aktualisiert ein oder mehrere Pakete auf Ihrem System.
Alias: update
dnf upgrade

Aktualisiert alle Pakete im System auf die neueste verfügbare Version.

# dnf upgrade
Last metadata expiration check: 1:09:32 ago on Thu Dec 14 09:20:48 2017.
Dependencies resolved.
Nothing to do.
Complete!
dnf upgrade Paketname

Aktualisiert ein Paket auf die neueste verfügbare Version.

# dnf upgrade dia
Last metadata expiration check: 1:11:26 ago on Thu Dec 14 09:20:48 2017.
Dependencies resolved.
Nothing to do.
Complete!
dnf install Paketname

Installiert ein Paket.

# dnf install dia
Last metadata expiration check: 1:07:19 ago on Thu Dec 14 09:20:48 2017.
Dependencies resolved.
=============================================================================
 Package          Arch           Version           Repository           Size
=============================================================================
Installing:
 dia              x86_64         1:0.97.3-5.fc24   fedora               4.2 M
 libart_lgpl      x86_64         2.3.21-15.fc25    fedora               71 k

Transaction Summary
=============================================================================
Install  2 Packages

Total download size: 4.2 M
Installed size: 18 M
Is this ok [y/N]: y
[... output truncated ...]
Installed:
  dia.x86_64 1:0.97.3-5.fc24          libart_lgpl.x86_64 2.3.21-15.fc25

Complete!
dnf remove Paketname

Deinstalliert ein Paket.

# dnf remove dia
Dependencies resolved.
=============================================================================
 Package          Arch           Version           Repository           Size
=============================================================================
Removing:
 dia              x86_64         1:0.97.3-5.fc24   @fedora              18 M
 libart_lgpl      x86_64         2.3.21-15.fc25    @fedora              126 k

Transaction Summary
=============================================================================
Remove  2 Packages

Installed size: 18 M
Is this ok [y/N]: y
[... output truncated ...]
Removed:
  dia.x86_64 1:0.97.3-5.fc24           libart_lgpl.x86_64 2.3.21-15.fc25

Complete!
dnf check-update

Prüft, ob für alle Pakete in den aktivierten Paketquellen Aktualisierungen verfügbar sind.

389-ds-base.x86_64                    1.3.7.5-11.el7           @updates
389-ds-base-libs.x86_64               1.3.7.5-11.el7           @updates
NetworkManager.x86_64                 1:1.10.2-3.el7           @updates
NetworkManager-config-server.noarch   1:1.10.2-3.el7           @updates
[... output truncated ...]
dnf search Schlüsselwort

Durchsucht die Paketmetadaten in den aktivierten Paketquellen nach dem angegebenen Schlüsselwort. Standardmäßig durchsucht der Befehl nur Paketnamen und -zusammenfassungen.

# dnf search freeipa
Last metadata expiration check: 1:12:31 ago on Thu Dec 14 09:20:48 2017.
========================================================================
freeipa-client.x86_64 : IPA authentication for use on clients
freeipa-common.noarch : Common files used by IPA
freeipa-server.x86_64 : The IPA authentication server
freeipa-server-dns.noarch : IPA integrated DNS server with support for automatic DNSSEC signing
freeipa-client-common.noarch : Common files used by IPA client
freeipa-python-compat.noarch : Compatibility package for Python libraries used by IPA
freeipa-server-common.noarch : Common files used by IPA server
freeipa-server-trust-ad.x86_64 : Virtual package to install packages required for Active Directory trusts
libsss_idmap.x86_64 : FreeIPA Idmap library
[... output truncated ...]
dnf info Paketname

Zeigt Details zu einem Paket an.

[root@localhost ~]# dnf info freeipa-server
Last metadata expiration check: 1:13:14 ago on Thu Dec 14 09:20:48 2017.
Available Packages
Name        : freeipa-server
Arch        : x86_64
Epoch       : 0
Version     : 4.4.4
Release     : 1.fc25
Size        : 380 k
Repo        : updates
Summary     : The IPA authentication server
URL         : https://www.freeipa.org/
License     : GPLv3+
Description : IPA is an integrated solution to provide centrally managed Identity (users,
            : hosts, services), Authentication (SSO, 2FA), and Authorization
            : (host access control, SELinux user roles, services). The solution provides
            : features for further integration with Linux based clients (SUDO, automount)
            : and integration with Active Directory based infrastructures (Trusts).
            : If you are installing an IPA server, you need to install this package.
dnf provides Befehl_oder_Datei

Zeigt an, welches Paket den angegebenen Befehl oder die angegebene Datei bereitstellt.

Einen Befehl angeben:

# dnf provides */ipa-server-install
Last metadata expiration check: 1:14:12 ago on Thu Dec 14 09:20:48 2017.
freeipa-server-4.4.1-1.fc25.x86_64 : The IPA authentication server
Repo        : fedora

freeipa-server-4.4.4-1.fc25.x86_64 : The IPA authentication server
Repo        : updates

Eine Datei angeben:

# dnf provides /etc/sssd/sssd.conf
Last metadata expiration check: 1:14:58 ago on Thu Dec 14 09:20:48 2017.
sssd-common-1.16.0-4.fc25.x86_64 : Common files for the SSSD
Repo        : @System

sssd-common-1.16.0-4.fc25.x86_64 : Common files for the SSSD
Repo        : updates

sssd-common-1.14.2-1.fc25.i686 : Common files for the SSSD
Repo        : fedora

sssd-common-1.14.2-1.fc25.x86_64 : Common files for the SSSD
Repo        : fedora
dnf history

Zeigt einen Bericht der vergangenen Transaktionen an.

# dnf history
ID     | Command line             | Date and time    | Action(s)      | Altered
 -------------------------------------------------------------------------------
     9 | update -y                | 2017-10-17 12:35 | I, U           |   17 EE
     8 | install midori           | 2017-10-13 10:44 | Install        |    3 >
     7 | update -y                | 2017-10-12 15:59 | Update         |    7
     6 | install keepass          | 2017-10-11 13:40 | Install        |   13  <
     5 | install thunderbird      | 2017-10-10 16:33 | Install        |    1 >
     4 | install sssd krb5-workst | 2017-10-10 15:30 | Install        |    3 >
     3 | install xchat            | 2017-10-10 15:19 | Install        |    4
     2 | update                   | 2017-10-10 13:44 | I, O, U        |  752 EE
     1 |                          | 2017-10-10 13:34 | Install        | 1373 EE
dnf list installed

Listet alle auf dem System installierten Pakete auf.

# dnf list installed
Last metadata expiration check: 1:17:33 ago on Thu Dec 14 09:20:48 2017.
Installed Packages
GConf2.x86_64                                                                                         3.2.6-16.fc24                                                                             @anaconda
GeoIP.x86_64                                                                                          1.6.11-1.fc25                                                                             @updates
GeoIP-GeoLite-data.noarch                                                                             2017.10-1.fc25                                                                            @updates
ImageMagick.x86_64                                                                                    6.9.9.19-1.fc25                                                                           @updates
ImageMagick-libs.x86_64                                                                               6.9.9.19-1.fc25                                                                           @updates
LibRaw.x86_64                                                                                         0.17.2-2.fc25                                                                             @updates
ModemManager.x86_64                                                                                   1.6.4-1.fc25                                                                              @updates
ModemManager-glib.x86_64                                                                              1.6.4-1.fc25                                                                              @updates
NetworkManager.x86_64                                                                                 1:1.4.6-1.fc25                                                                            @updates
[... output truncated ...]