GNU/Linux >> Linux Esercitazione >  >> Fedora

Nozioni di base su Linux:15 esempi di comandi DNF – Nuovo Package Manager in Fedora

Spero che tu sappia che il gestore di pacchetti DNF è stato sostituito dal gestore di pacchetti yum in Fedora 22. Ecco alcuni esempi su come utilizzare il gestore di pacchetti DNF.

Mantiene la compatibilità CLI con yum, non troverai alcuna differenza nell'uso di DNF.

Puoi ancora usare il comando YUM, ma tutti i comandi verranno reindirizzati al rispettivo comando DNF. Otterrai un output simile quando esegui il comando yum.

Yum command has been deprecated, redirecting to '/usr/bin/dnf install httpd'

I pacchetti possono essere installati utilizzando il seguente comando.

# dnf install vsftpd

Last metadata expiration check performed 0:09:43 ago on Wed May 27 08:47:24 2015.
Dependencies resolved.
========================================================================================================================================================================
Package                               Arch                                  Version                                        Repository                             Size
========================================================================================================================================================================
Installing:
vsftpd                                x86_64                                3.0.2-13.fc22                                  fedora                                172 k

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

Total download size: 172 k
Installed size: 348 k
Is this ok [y/N]: y
Downloading Packages:
vsftpd-3.0.2-13.fc22.x86_64.rpm                                                                                                         107 kB/s | 172 kB     00:01
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                    48 kB/s | 172 kB     00:03
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Installing  : vsftpd-3.0.2-13.fc22.x86_64                                                                                                                         1/1
Verifying   : vsftpd-3.0.2-13.fc22.x86_64                                                                                                                         1/1

Installed:
vsftpd.x86_64 3.0.2-13.fc22

Complete!

Elenca i pacchetti disponibili. Ad esempio, elencheremo il pacchetto Apache.

# dnf list bind

Last metadata expiration check performed 0:11:38 ago on Wed May 27 08:47:24 2015.
Available Packages
bind.x86_64                                                                   32:9.10.2-1.fc22                                                                    fedora

Per reinstallare il pacchetto rpm.

# dnf reinstall httpd

Last metadata expiration check performed 0:14:17 ago on Wed May 27 08:47:24 2015.
No match for argument: httpd
Error: Nothing to do.
[root@localhost ~]# dnf reinstall vsftpd
Last metadata expiration check performed 0:14:32 ago on Wed May 27 08:47:24 2015.
Dependencies resolved.
========================================================================================================================================================================
Package                               Arch                                  Version                                        Repository                             Size
========================================================================================================================================================================
Reinstalling:
vsftpd                                x86_64                                3.0.2-13.fc22                                  fedora                                172 k

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

Total download size: 172 k
Is this ok [y/N]: y
Downloading Packages:
vsftpd-3.0.2-13.fc22.x86_64.rpm                                                                                                         118 kB/s | 172 kB     00:01
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                    53 kB/s | 172 kB     00:03
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Reinstalling: vsftpd-3.0.2-13.fc22.x86_64                                                                                                                         1/2
Erasing     : vsftpd-3.0.2-13.fc22.x86_64                                                                                                                         2/2
Verifying   : vsftpd-3.0.2-13.fc22.x86_64                                                                                                                         1/2
Verifying   : vsftpd-3.0.2-13.fc22.x86_64                                                                                                                         2/2

Reinstalled:
vsftpd.x86_64 3.0.2-13.fc22

Complete!

Per rimuovere tutti i pacchetti che desideri, emetti il ​​seguente comando.

# dnf remove vsftpd

Dependencies resolved.
========================================================================================================================================================================
Package                               Arch                                  Version                                       Repository                              Size
========================================================================================================================================================================
Removing:
vsftpd                                x86_64                                3.0.2-13.fc22                                 @System                                348 k

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

Installed size: 348 k
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Erasing     : vsftpd-3.0.2-13.fc22.x86_64                                                                                                                         1/1
Verifying   : vsftpd-3.0.2-13.fc22.x86_64                                                                                                                         1/1

Removed:
vsftpd.x86_64 3.0.2-13.fc22

Complete!

Per controllare la cronologia dell'installazione del pacchetto.

# dnf history

Last metadata expiration check performed 0:15:57 ago on Wed May 27 08:47:24 2015.
ID     | Login user               | Date a | Action | Altere
-------------------------------------------------------------------------------
10 | root               | 2015-05-27 09:02 | Reinstall      |    1
9 | root               | 2015-05-27 09:01 | Install        |    1
8 | root               | 2015-05-27 08:59 | Erase          |    1
7 | root               | 2015-05-27 08:59 | Erase          |    6
6 | root               | 2015-05-27 08:57 | Install        |    1
5 | root               | 2015-05-27 08:56 | Install        |    6
4 | root               | 2015-05-27 08:47 | Install        |    5
3 | System            | 2015-05-26 21:30 | Install        |  658 EE

Effettua il downgrade dei tuoi pacchetti. Questo comando non funzionerà a meno che tu non disponga di una versione inferiore del pacchetto menzionato.

# dnf downgrade vsftpd

Per cercare un pacchetto particolare.

# dnf search telnet

Per escludere un pacchetto dall'installazione. Ad esempio, il pacchetto fedora-logos-httpd verrà escluso durante l'installazione di apache.

# dnf install httpd --exclude fedora-logos-httpd

Per abilitare / disabilitare il repository durante l'installazione dei pacchetti.

# dnf install httpd --enablerepo fedora

# dnf install httpd --disablerepo fedora

Elenca l'ambiente disponibile/i gruppi di pacchetti.

# dnf grouplist

Installa qualsiasi gruppo di pacchetti.

# dnf groupinstall "MATE Desktop"

Scarica il pacchetto selezionato con le sue dipendenze in qualsiasi directory.

# dnf download httpd --resolve --destdir /tmp/

Per memorizzare nella cache/pulire i metadati.

# dnf makecache

# dnf clean all

Puoi ottenere maggiori informazioni dai comandi seguenti.

# dnf --help

# man dnf

Questo è tutto.


Fedora
  1. sa Esempi di comandi in Linux

  2. w Esempi di comandi in Linux

  3. ac Esempi di comandi in Linux

  4. Esempi di comandi df in Linux

  5. du Esempi di comandi in Linux

26 Esempi di comandi DNF in Fedora / CentOS / RHEL

Nozioni di base su Linux:30 esempi di comandi YUM per la gestione dei pacchetti Linux

Novità di Fedora 32 Workstation

Come velocizzare il gestore di pacchetti DNF in Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux

Esempi di comandi 12 RPM (Red Hat Package Manager).

Esempi di comandi id in Linux