DNF5

The new era in RPM software management

How we rewrote the codebase and started loving the community

Aleš Matěj - Nicola Sella - Jan Kolárik

Introduction

  1. Technical overview of DNF5 - Aleš Matěj
  2. Community, history and action items - Nicola Sella
  3. Live demo - Jan Kolárik

What is a package manager?

  • Something like a command line app-store (backend)
  • It installs, upgrades and removes packages, handles metadata, resolves dependencies…)
  • Examples: DNF, microdnf, Zypper, APT, PACMAN

What is a package manager?

GUI user

CLI user

Software Center

PackageKit
High Level Manager
DNF, APT, pacman
Low Level Manager
RPM, dpkg
LIBDNF
hawkey
python-hawkey
libhif
plugins
dnf
microdnf
PackageKit
plugins
LIBDNF
hawkey
python-hawkey
libhif
plugins
dnf
microdnf
PackageKit
plugins

DNF5

plugins
dnf5
daemon
plugins

LIBDNF5

libdnf5

  • Complete restructure of API ➜ safer and unified
  • Repositories are downloaded and loaded at the same time
  • Filelists metadata not downloaded by default
  • Faster in general
  • SWIG bindings for: Python, Perl, Ruby, Go

DNF5 (CLI)

  • Python is not required
  • Commands are mostly the same
  • Outputs of commands did change
  • DNF CI tests are the same for DNF5


DNF5 daemon

  • Accessible by D-Bus
  • Same functionality as dnf5

List of additional DNF5 improvements:

  • Configurable aliases
  • Fully integrated Modularity in LIBDNF5 workflows
  • Single configuration for LIBDNF5 users
  • Separation of system state from history DB and module state
  • Autocomplete built in
  • ...

Community

The Upstream: rpm-software-management/dnf5

How do we plan to work closer with the community?

  • Looking at the past of the projects
  • Looking at the future of our contributors
  • Our action items

Looking at the past of the projects

Looking at the past of the projects

Very few people are doing all the work

How the efforts are shifting from 2022

LIBDNF (2012-today)

DNF5 (2020-tomorrow?)

DNF (2012-today)

Where do we want to go? Looking at the future of our contributors

Where do we want to go? Looking at the future of our contributors

  • 💻 Authors, Owners ~10% commits
  • 👏 Co-Authors, Paid programmers ~100 commits
  • 🤔: The People in the Middle
  • 🧩:Beginners, one timers

DNF Weekly Contribuitons

All (225) 💻 4 (1.7%) 👏 19 (8%)
9347 3944 1156
To be in 1% ~80 ~40 ~11
To be in 5% ~500 ~190 ~50

DNF5 Weekly Contributions

All (19) 💻 5 (26%) 👏 6 (31%)
1981 336 197
To be in 1% ~20 ~<4 ~<2
To be in 5% ~100 ~16 ~10

LIBDNF Weekly Contributions

All (95) 💻 3 (3%) 👏 8 (8%)
3140 1597 1005
To be in 1% 32 18 10
To be in 5% 150 83 50

Action Items: transparent workflow...

  • Issues: triaged weekly, divided in milestones
  • Discussions: opinions, announcements, questions
  • Bugzilla: bug tracking, downstream requests

Discussions

Community opinions

Announcements

Questions from the community

...in addition

  • Documentation: generated from codebase, tested, includes code templates and tutorials
  • Contributing guides: first time issues

So, who is the community?

  • People who create issues, add code, take part in discussions
  • People who raise questions, use dnf5
  • People who help, ask for help

DEMO

API DEMO 1

                                                
import libdnf5 as dnf

base = dnf.base.Base()
base.setup()

for release in ['35', '36', '37']:
    base.get_vars().set('releasever', release)

    sack = base.get_repo_sack()
    sack.create_repos_from_system_configuration()
    sack.update_and_load_enabled_repos(False)

    query = dnf.rpm.PackageQuery(base)
    query.filter_name(["kernel"])
    query.filter_latest_evr()

    found = next(iter(query), None)
    pkg_name = found.get_nevra() if found else "N/A"
    print(f'{release}: {pkg_name}')
                                                
                                            

API DEMO 2

                                                
import libdnf5 as dnf

base = dnf.base.Base()
base.setup()

sack = base.get_repo_sack()
sack.create_repos_from_system_configuration()
sack.update_and_load_enabled_repos(False)

goal = dnf.base.Goal(base)
goal.add_rpm_install("zlib")
ts = goal.resolve()

downloader = dnf.repo.PackageDownloader()
for pkg in ts.get_transaction_packages():
    if dnf.base.transaction.\
       transaction_item_action_is_inbound(pkg.get_action()):
        downloader.add(pkg.get_package(), "download")

downloader.download(True, True)
print("Download finished.")
                                                
                                            

Deploying a simple DNF5 plugin

What do we need?

  • Devel and bindings packages
  • Template sources
  • Build tools (f.e. CMake)

Deploying a simple DNF5 plugin

How to write it?

  • Definition
  • Implementation
  • Adapter A.K.A. boilerplate

Deploying a simple DNF5 plugin

Implementation

                                            

                                            
                                        

Deploying a simple DNF5 plugin

Adapter

                                            

                                            
                                    

Thank you for joining us!

Thank you for joining us!

Where are we?

Link
GitHub Repo https://github.com/rpm-software-management/dnf5
GitHub Issues https://github.com/rpm-software-management/dnf5/issues
GitHub discussions https://github.com/rpm-software-management/dnf5/discussions
Documentation https://dnf5.readthedocs.io

How to try dnf5?

Where How
Fedora 36/37 dnf copr enable rpmsoftwaremanagement/dnf5-unstable
Fedora 38 dnf install dnf5

Thank you for joining us!

Where are we?

Link
GitHub Repo https://github.com/rpm-software-management/dnf5
GitHub Issues https://github.com/rpm-software-management/dnf5/issues
GitHub discussions https://github.com/rpm-software-management/dnf5/discussions
Documentation https://dnf5.readthedocs.io

When will DNF5 land in Fedora?

When What Where
Fedora 36/37 DNF5 is available in Copr
Fedora 38 DNF5 will replace microdnf Major Upgrade Of Microdnf
Fedora 39 DNF5 will replace DNF Replace Dnf With Dnf5