GNU/Linux >> Linux Esercitazione >  >> Linux

Come installare i pacchetti usando dnf in CentOS/RHEL 8

CentOS/RHEL ha un nuovo gestore di pacchetti chiamato DNF che può essere utilizzato per installare i pacchetti sui sistemi CentOS/RHEL 8. DNF o Dandified YUM è la versione di nuova generazione di Yellowdog Updater Modified (yum), un gestore di pacchetti per distribuzioni basate su rpm in CentOS/RHEL 8. Risolve anche le dipendenze automaticamente.

Quello che segue è un esempio di come utilizzare DNF per verificare quali repository sono abilitati e quindi installare un pacchetto da un repository abilitato.

1. Per controllare l'elenco dei repository abilitati sul sistema, eseguire:

# dnf repolist
This system is receiving updates from Spacewalk server.
Last metadata expiration check: 0:56:04 ago on Fri 26 Jul 2019 03:12:16 AM EDT.
repo id repo name status
el8_x86_64_appstream RedHat Linux 8 Application Stream Packages (x86_64) 6,470
el8_x86_64_baseos_latest RedHat Linux 8 BaseOS Latest (x86_64) 2,166

2. Per installare un pacchetto specifico, procedi come segue:

# dnf install httpd
This system is receiving updates from Spacewalk server.
Last metadata expiration check: 0:08:48 ago on Fri 26 Jul 2019 03:12:16 AM EDT.
Dependencies resolved.
=============================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================
Installing:
httpd x86_64 2.4.37-10.0.2.module+el8+5189+8bc260ed ol8_x86_64_appstream 1.4 M
Installing dependencies:
mailcap noarch 2.1.48-3.el8 ol8_x86_64_baseos_latest 39 k
oracle-logos-httpd noarch 80.5-1.0.3.el8 ol8_x86_64_baseos_latest 27 k
mod_http2 x86_64 1.11.3-1.module+el8+5189+8bc260ed ol8_x86_64_appstream 156 k
apr x86_64 1.6.3-9.el8 ol8_x86_64_appstream 125 k
httpd-filesystem noarch 2.4.37-10.0.2.module+el8+5189+8bc260ed ol8_x86_64_appstream 34 k
apr-util x86_64 1.6.1-6.el8 ol8_x86_64_appstream 105 k
httpd-tools x86_64 2.4.37-10.0.2.module+el8+5189+8bc260ed ol8_x86_64_appstream 101 k
Enabling module streams:   <<<<<<<<<<<<<<<<<<<<<<<<<<<    httpd module steam has been enabled on system 
httpd 2.4

Transaction Summary
=============================================================================================================================================================================================================================================
Install 8 Packages

Total download size: 2.0 M
Installed size: 5.5 M

Se il pacchetto installato da DNF è un modulo (come httpd), DNF abiliterà automaticamente il modulo sul sistema.

Nota :nell'esempio precedente, il pacchetto httpd viene installato dal repository appstream. Se sono presenti dipendenze mancanti per il pacchetto httpd, DNF le installerà automaticamente anziché richiedere all'utente di approvarne l'installazione. Nell'esempio seguente possiamo vedere più pacchetti aggiuntivi sia dal repository baseos che da quello appstream che vengono installati automaticamente perché sono dipendenze obbligatorie del pacchetto httpd.


Linux
  1. Come installare DNF su CentOS 7

  2. Come installare Ruby 2.0.0 su CentOS e RHEL 6 usando RVM

  3. Come estrarre il pacchetto 7z in CentOS/RHEL/Fedora?

  4. Come installare il pacchetto Mokutil su CentOS/RHEL 7 e 8

  5. Come installare gcc8 usando devtoolset-8-gcc

Come installare e gestire i pacchetti su CentOS utilizzando RPM

Come installare in modo sicuro i pacchetti utilizzando Npm o Yarn su Linux

Come installare i pacchetti RPM su CentOS 8

Come installare i pacchetti RPM in CentOS, RHEL e Fedora

Come installare flameshot su RHEL/CentOS usando Snapcraft

Come installare EPEL Repo su CentOS e RHEL 7?