GNU/Linux >> Tutoriales Linux >  >> Fedora

Conceptos básicos de Linux:15 ejemplos de comandos DNF – Nuevo administrador de paquetes en Fedora

Espero que sepa que el administrador de paquetes DNF reemplazó al administrador de paquetes yum en Fedora 22. Aquí hay algunos ejemplos sobre cómo usar el administrador de paquetes DNF.

Mantiene la compatibilidad de CLI con yum, no encontrará ninguna diferencia en el uso de DNF.

Todavía puede usar el comando YUM, pero todos los comandos serán redirigidos al comando DNF respectivo. Obtendrá un resultado similar cuando emita el comando yum.

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

Los paquetes se pueden instalar usando el siguiente 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!

Enumere los paquetes disponibles. Por ejemplo, enumeraremos el paquete 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

Para reinstalar el paquete 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!

Para eliminar cualquier paquete que desee, emita el siguiente 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!

Para comprobar el historial de instalación de paquetes.

# 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

Rebaja tus paquetes. Este comando no funcionará a menos que tenga una versión anterior del paquete mencionado.

# dnf downgrade vsftpd

Para buscar un paquete en particular.

# dnf search telnet

Para excluir un paquete de la instalación. Por ejemplo, el paquete fedora-logos-httpd se excluirá al instalar apache.

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

Para habilitar / deshabilitar el repositorio durante la instalación de paquetes.

# dnf install httpd --enablerepo fedora

# dnf install httpd --disablerepo fedora

Enumera los grupos de paquetes/entornos disponibles.

# dnf grouplist

Instale cualquier grupo de paquetes.

# dnf groupinstall "MATE Desktop"

Descargue el paquete seleccionado con sus dependencias a cualquier directorio.

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

Para almacenar en caché/limpiar los metadatos.

# dnf makecache

# dnf clean all

Puede obtener más información de los siguientes comandos.

# dnf --help

# man dnf

Eso es todo.


Fedora
  1. 7 ejemplos de comandos Linux df

  2. 8 ejemplos de comandos TR de Linux

  3. 15 ejemplos de comandos de aptitude para la gestión de paquetes en Linux

  4. Ejemplos de comandos rm en Linux

  5. Ejemplos de comandos ps en Linux

26 ejemplos de comandos DNF en Fedora / CentOS / RHEL

Conceptos básicos de Linux:30 ejemplos de comandos YUM para la gestión de paquetes de Linux

Novedades en la estación de trabajo Fedora 32

Cómo acelerar el administrador de paquetes DNF en Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux

Ejemplos de comandos de 12 RPM (Administrador de paquetes de Red Hat)

Ejemplos de comandos id en Linux