Instalacja pakietów

sudo dnf install <nazwa-pakietu>
sudo dnf install borgbackup
Last metadata expiration check: 0:16:01 ago on Mon 25 Mar 2019 02:58:33 PM CET
Dependencies resolved.
==============================================================================
 Package                Architecture  Version             Repository      Size
==============================================================================
Installing:
 borgbackup             x86_64        1.1.7-2.fc30        rawhide        980 k
Installing dependencies:
 python3-llfuse         x86_64        1.3.5-2.fc30        rawhide        373 k
 python3-msgpack        x86_64        0.6.1-2.fc30        rawhide         90 k

Transaction Summary
==============================================================================
Install  3 Packages

Total download size: 1.4 M
Installed size: 5.9 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): python3-msgpack-0.6.1-2.fc30.x86_64.rpm 276 kB/s |  90 kB     00:00
(2/3): python3-llfuse-1.3.5-2.fc30.x86_64.rpm  438 kB/s | 373 kB     00:00
(3/3): borgbackup-1.1.7-2.fc30.x86_64.rpm      901 kB/s | 980 kB     00:01
------------------------------------------------------------------------------
Total                                          661 kB/s | 1.4 MB     00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                       1/1
  Installing       : python3-msgpack-0.6.1-2.fc30.x86_64                   1/3
  Installing       : python3-llfuse-1.3.5-2.fc30.x86_64                    2/3
  Installing       : borgbackup-1.1.7-2.fc30.x86_64                        3/3
  Running scriptlet: borgbackup-1.1.7-2.fc30.x86_64                        3/3
  Verifying        : borgbackup-1.1.7-2.fc30.x86_64                        1/3
  Verifying        : python3-llfuse-1.3.5-2.fc30.x86_64                    2/3
  Verifying        : python3-msgpack-0.6.1-2.fc30.x86_64                   3/3

Installed:
  borgbackup-1.1.7-2.fc30.x86_64         python3-llfuse-1.3.5-2.fc30.x86_64
  python3-msgpack-0.6.1-2.fc30.x86_64

Complete!

Instalacja pakietów z pliku

sudo dnf install $(cat userinstalled.txt)

Usunięcie pakietu

sudo dnf remove borgbackup
Dependencies resolved.
=============================================================================
 Package               Architecture Version              Repository      Size
=============================================================================
Removing:
 borgbackup            x86_64       1.1.7-2.fc30         @rawhide       4.1 M
Removing unused dependencies:
 python3-llfuse        x86_64       1.3.5-2.fc30         @rawhide       1.5 M
 python3-msgpack       x86_64       0.6.1-2.fc30         @rawhide       283 k

Transaction Summary
=============================================================================
Remove  3 Packages

Freed space: 5.9 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                      1/1
  Erasing          : borgbackup-1.1.7-2.fc30.x86_64                       1/3
  Erasing          : python3-llfuse-1.3.5-2.fc30.x86_64                   2/3
  Erasing          : python3-msgpack-0.6.1-2.fc30.x86_64                  3/3
  Running scriptlet: python3-msgpack-0.6.1-2.fc30.x86_64                  3/3
  Verifying        : borgbackup-1.1.7-2.fc30.x86_64                       1/3
  Verifying        : python3-llfuse-1.3.5-2.fc30.x86_64                   2/3
  Verifying        : python3-msgpack-0.6.1-2.fc30.x86_64                  3/3

Removed:
  borgbackup-1.1.7-2.fc30.x86_64         python3-llfuse-1.3.5-2.fc30.x86_64
  python3-msgpack-0.6.1-2.fc30.x86_64

Complete!

Wyszukanie pakietu

Do wyszukiwania służy komenda search

dnf search borg
Fedora - Modular Rawhide - Dev 502 kB/s | 1.0 MB
Fedora - Rawhide - Developmental packages for the next Fe 1.5 MB/s |  61 MB     00:39
Last metadata expiration check: 0:00:01 ago on Mon 25 Mar 2019 11:50:32 AM CET.
============================== Name & Summary Matched: borg ==============================
borgmatic.x86_64 : Simple Python wrapper script for borgbackup
=================================== Name Matched: borg ===================================
borgbackup.x86_64 : A deduplicating backup program with compression and authenticated
                  : encryption
borgbackup.x86_64 : A deduplicating backup program with compression and authenticated
                  : encryption

Informacje o wersji pakietu, który jest zainstalowany lub chcemy zainstalować

W tym przypadku musimy podać dokładną nazwę pakietu np. borgbackup lub użyć wyrażeń regularnych np. kernel-core*5.1*

dnf info borgbackup
Last metadata expiration check: 0:02:40 ago on Mon 25 Mar 2019 11:50:32 AM CET.
Installed Packages
Name         : borgbackup
Version      : 1.1.7
Release      : 2.fc30
Architecture : x86_64
Size         : 4.1 M
Source       : borgbackup-1.1.7-2.fc30.src.rpm
Repository   : @System
From repo    : rawhide
Summary      : A deduplicating backup program with compression and authenticated
             : encryption
URL          : https://borgbackup.readthedocs.org
License      : BSD
Description  : BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it
             : supports compression and authenticated encryption.
dnf info kernel-core*5.1*
Last metadata expiration check: 0:16:28 ago on Mon 25 Mar 2019 11:50:32 AM CET.
Installed Packages
Name         : kernel
Version      : 5.1.0
Release      : 0.rc1.git1.1.fc31
Architecture : x86_64
Size         : 0.0
Source       : kernel-5.1.0-0.rc1.git1.1.fc31.src.rpm
Repository   : @System
From repo    : rawhide
Summary      : The Linux kernel
URL          : https://www.kernel.org/
License      : GPLv2 and Redistributable, no modification permitted
Description  : The kernel meta package

Komenda list wyświetla mniej informacji, a mianowicie, czy pakiet jest zainstalowany czy po prostu dostępny, nazwę pakietu / architekturę, wersję oraz nazwę repozytorium, które zawiera ten pakiet.

dnf list i3lock
Last metadata expiration check: 0:24:25 ago on Mon 25 Mar 2019 11:50:32 AM CET.
Available Packages
i3lock.x86_64                             2.11.1-2.fc30                             rawhide
dnf list dwm-user
Last metadata expiration check: 0:24:07 ago on Mon 25 Mar 2019 11:50:32 AM CET.
Installed Packages
dwm-user.x86_64               6.2-2.module_f31+3286+e6bdb11e               @rawhide-modular

Lista zainstalowanych pakietów przez użytkownika bez zależności

Lista pakietów, polecenie wyświetla wersję zainstalowanych pakietów

sudo dnf history userinstalled

Lista pakietów, polecenie wyświetlana tylko nazwę pakietu

sudo dnf repoquery --qf "%{name}" --userinstalled > userinstalled.txt

Lista pakietów w repozytorium

sudo dnf repository-packages fedora-cisco-openh264 list

Aktualizacja po jednym pakiecie na raz

sudo dnf list updates | sed -n '3,$p' | awk '{ print $1 }' | xargs -I{} sudo dnf update -y {}

Aliasy dla komendy dnf

Do pliku .bashrc lub .zshrc dodajemy

if [ -f "/etc/fedora-release" ]; then
    alias dnf='sudo dnf'
    alias di='sudo dnf install'
    alias dr='sudo dnf remove'
    alias ds='dnf search'
    alias dl='dnf list'
    alias ddep='dnf deplist'
    alias update='sudo dnf update --refresh'
    alias upgrade=update
    alias rpm='sudo rpm'
    alias yum='sudo yum'
fi

Date: 2020-10-24T17:25:28+02:00