Package manager based on libdnf and libsolv. Replaces YUM.

Overview
Translation status

Dandified YUM

https://raw.githubusercontent.com/rpm-software-management/dnf/gh-pages/logos/DNF_logo.png

Dandified YUM (DNF) is the next upcoming major version of YUM. It does package management using RPM, libsolv and hawkey libraries. For metadata handling and package downloads it utilizes librepo. To process and effectively handle the comps data it uses libcomps.

Installing

DNF and all its dependencies are available in Fedora 18 and later, including the rawhide Fedora.

Optionally you can use repositories with DNF nightly builds for last 2 stable Fedora versions available at copr://rpmsoftwaremanagement/dnf-nightly. You can enable the repository e.g. using:

dnf copr enable rpmsoftwaremanagement/dnf-nightly

Then install DNF typing:

sudo yum install dnf

In other RPM-based distributions you need to build all the components from their sources.

Building from source

All commands should be run from the DNF git checkout directory.

To install the build dependencies:

sudo dnf builddep dnf.spec

To build DNF:

mkdir build;
pushd build;
cmake ..; # add '-DPYTHON_DESIRED="3"' option for Python 3 build
make;
popd;

To run DNF when compiled for Python2:

PYTHONPATH=`readlink -f .` bin/dnf-2 <arguments>

To run DNF when compiled for Python3:

PYTHONPATH=`readlink -f .` bin/dnf-3 <arguments>

If you want to build the manpages, use the option -DWITH_MAN=0 with cmake.

Man pages will be located in build/doc and can be read with man -l, e.g:

man -l build/doc/dnf.8

Building and installing rpm

From the DNF git checkout directory:

$ tito build --test --rpm
# dnf install /tmp/tito/noarch/*

Running tests

From the DNF git checkout directory:

mkdir build;
pushd build;
cmake .. && make ARGS="-V" test;
popd;

Contribution

Here's the most direct way to get your work merged into the project.

  1. Fork the project

  2. Clone down your fork

  3. Implement your feature or bug fix and commit changes

  4. If the change fixes a bug at Red Hat bugzilla, or if it is important to the end user, add the following block to the commit message:

    = changelog =
    msg:           message to be included in the changelog
    type:          one of: bugfix/enhancement/security (this field is required when message is present)
    resolves:      URLs to bugs or issues resolved by this commit (can be specified multiple times)
    related:       URLs to any related bugs or issues (can be specified multiple times)
    
    • For example:

      = changelog =
      msg: Verify GPG signatures when running dnf-automatic
      type: bugfix
      resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1793298
      
    • For your convenience, you can also use git commit template by running the following command in the top-level directory of this project:

      git config commit.template ./.git-commit-template
      
  5. In special commit add your name and email under DNF CONTRIBUTORS section in authors file as a reward for your generosity

  6. Push the branch up to your fork

  7. Send a pull request for your branch

Please, do not create the pull requests with translation (.po) files improvements. Fix the translation on Fedora Weblate instead.

Documentation

The DNF package distribution contains man pages, dnf(8) and dnf.conf(8). It is also possible to read the DNF documentation online, the page includes API documentation. There's also a wiki meant for contributors to DNF and related projects.

Bug reporting etc.

Please report discovered bugs to the Red Hat bugzilla following this guide. If you planned to propose the patch in the report, consider Contribution instead.

Freenode's irc channel #yum is meant for discussions related to both YUM and DNF. Questions should be asked there, issues discussed. Remember: #yum is not a support channel and prior research is expected from the questioner.

Comments
  • Transaction Store/Replay

    Transaction Store/Replay

    The basics work, there are TODOs scattered through the code.

    What remains to be done:

    • Check for when a package in transaction wasn't found
    • Check for when an additional package was pulled in on the replay side
    • Check the "from" versions on the target system (for a --strict mode?)
    • Support for groups
    • Cleanups

    I'm calling the modules etc. in various places transaction_sr or transaction-sr, though I'm not too happy with the name, would change it to a better one but can't think of any.

    Requires this libdnf PR: https://github.com/rpm-software-management/libdnf/pull/972 Tests: https://github.com/rpm-software-management/ci-dnf-stack/pull/845

    changes requested 
    opened by lukash 63
  • Prevent memory leaks of Query from security filters and for plugins

    Prevent memory leaks of Query from security filters and for plugins

    I am not really sure how this works but if we keep a reference to a Hawkey object after calling reset (close), which are called by __del__ and __exit__, the reference doesn't get decremented and the Hawkey object leaks memory.

    I am a little worried its hiding some other issue but like I said I don't know.

    With these changes running ci-dnf-stack with sanitizers (meaning libdnf is compiled with them) doesn't report any memory leaks.

    The dnf unittests however report memory problems but I think this is caused by all the mock and stub setups since running dnf normally is fine. My second commit fixes a couple but there is more in the more complex unittests.

    ready for review 
    opened by kontura 37
  • Better handling of output columns when used noninteractively (RhBug 1512956)

    Better handling of output columns when used noninteractively (RhBug 1512956)

    When not used in interactive terminal width of output colums is set to maximal required size in order to avoid splitting output columns into multiple lines.

    https://bugzilla.redhat.com/show_bug.cgi?id=1512956

    opened by m-blaha 35
  • [modularity] module enabling based on rpms

    [modularity] module enabling based on rpms

    • module list output fixed
    • module enabling based on rpms
    • do not enable module when transaction fails
    • enable module runtime dependencies, when enabling module:stream
    • accept no profile when installing module, but inform user about it
    • install new rpms when updating profiles
    • limit the width of module list command
    opened by mhatina 32
  • [new feature] use both CliTransactionDisplay and demands.transaction_display

    [new feature] use both CliTransactionDisplay and demands.transaction_display

    Tested with this plugin:

    import dnf.cli.output
    
    class Disp(dnf.yum.rpmtrans.TransactionDisplay):
        def event(self, package, action, te_current, te_total, ts_current, ts_total):
            if te_current == te_total:
                print('event')
        def scriptout(self, msgs):
            print('scriptout')
        def verify_tsi_package(self, pkg, count, total):
            print('verify')
        def errorlog(self, msg):
            print('error')
        def filelog(self, package, action):
            print('filelog')
    
    class Command(dnf.cli.Command):
        aliases = ['foo']
        def configure(self, args):
            self.cli.demands.available_repos = True
            self.cli.demands.sack_activation = True
            self.cli.demands.resolving = True
            self.cli.demands.root_user = True
            self.cli.demands.transaction_display = Disp()
        def run(self, args):
            for arg in args:
                self.base.install(arg)
    
    class Plugin(dnf.Plugin):
        name = 'foo'
        def __init__(self, base, cli):
            super(Plugin, self).__init__(base, cli)
            if cli:
                cli.register_command(Command)
    

    I'd also consider changing demands.transaction_display to demands.transaction_displays.

    opened by ghost 32
  • WIP: SWDB preview

    WIP: SWDB preview

    Hi, this is preview for SWDB integration in DNF. Most of functions should be working now, old databases are not used anymore. It would be fine to have separate branch for that...

    It requires dnf-swdb libhif module, see https://github.com/edynox/libhif

    demo.pdf

    opened by edcuba 31
  • Format history table to use actual terminal width (RhBug:1786316 Fedora)

    Format history table to use actual terminal width (RhBug:1786316 Fedora)

    dnf history command's output is limited to 79 columns regardless of the actual terminal width. This often results in the commands column being trimmed, and makes it impossible to see the complete history information.

    This patch makes dnf use the actual terminal width to fit as much information as possible into the output.

    Bz 1786316 (https://bugzilla.redhat.com/show_bug.cgi?id=1786316)

    opened by ivanpesin 30
  • Add DemandSheet.transaction_display

    Add DemandSheet.transaction_display

    This commit adds Base.transaction_display, which should be either None or an instance of dnf.yum.rpmtrans.TransactionDisplay (or a subclass thereof).

    If Base.do_transaction() is called without a 'display' argument, it will use self.transaction_display as the default value.

    It defaults to None. BaseCli sets it to output.CliTransactionDisplay().

    Moving it to an attribute allows Plugins and/or Commands to add their own TransactionDisplay - for example, fedup or offline-updates could use this to send status info to plymouth during the upgrade transaction.

    opened by wgwoods 28
  • Bash-completion improvements (RhBug:1368651) (RhBug:1369847) (RhBug:1361698)

    Bash-completion improvements (RhBug:1368651) (RhBug:1369847) (RhBug:1361698)

    https://bugzilla.redhat.com/show_bug.cgi?id=1369847 https://bugzilla.redhat.com/show_bug.cgi?id=1368651 https://bugzilla.redhat.com/show_bug.cgi?id=1361698 https://bugzilla.redhat.com/show_bug.cgi?id=1270295

    opened by mkutlak 27
  • Not print help if empty line in script for shell command

    Not print help if empty line in script for shell command

    If empty line was in script it prints help because shlex.split(line) was unable to split it. It could be confusing for some users to see help for no obvious reason.

    opened by j-mracek 27
  • [modularity] usage of includes (test thoroughly)

    [modularity] usage of includes (test thoroughly)

    • consistent sorting in module list
    • usage of includes also with defaults (needed for autoenabling based on rpms)
    • do not allow to lock different version when already locked
    • fail when trying to lock different version than installed
    opened by mhatina 26
  • api:  cleanup dnf.Base.package_remove and make it public api

    api: cleanup dnf.Base.package_remove and make it public api

    • Added check for if the package is installed
    • raise dnf.exceptions.MarkingError is not installed.
    • added clean_deps flag to goal.erase to handle removal of deps (same as in dnf.Base.remove)

    dnfdaemon and yumex-ng uses the dnf.Base.package_remove to mark a installed package for installation, but need workarounds because it don't handle deps in the current state. And using non public API is not a good thing.

    opened by timlau 0
  • Omit src RPMs from check-update (RhBug: 2151910)

    Omit src RPMs from check-update (RhBug: 2151910)

    The current check-update operation relies on src RPMs not being included in the available repos. When those repos are enabled, *.src RPMs can be emitted as updates that are available. Those RPMs are not updated in the traditional fashion and can cause confusion to end users.

    This change implements a "include_src=" flag in the _list_patterns() callpath. It is set to True by default to maintain compatibility with existing behaviours. The returnPkgLists() CLI callpath sets this value to False for check-update purposes.

    = changelog = type: bugfix resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2151910

    opened by kyle-walker 0
  • dnf help: simplify usage message line

    dnf help: simplify usage message line

    Currently the usage message line of dnf help <command is a long string, e.g. for remove it is (line number added)

     1 usage: dnf remove [-c [config file]] [-q] [-v] [--version] [--installroot [path]]
     2                   [--nodocs] [--noplugins] [--enableplugin [plugin]]
     3                   [--disableplugin [plugin]] [--releasever RELEASEVER] [--setopt SETOPTS]
     4                   [--skip-broken] [-h] [--allowerasing] [-b | --nobest] [-C]
     5                   [-R [minutes]] [-d [debug level]] [--debugsolver] [--showduplicates]
     6                   [-e ERRORLEVEL] [--obsoletes] [--rpmverbosity [debug level name]] [-y]
     7                   [--assumeno] [--enablerepo [repo]] [--disablerepo [repo] | --repo
     8                   [repo]] [--enable | --disable] [-x [package]] [--disableexcludes [repo]]
     9                   [--repofrompath [repo,path]] [--noautoremove] [--nogpgcheck]
    10                   [--color COLOR] [--refresh] [-4] [-6] [--destdir DESTDIR]
    11                   [--downloadonly] [--comment COMMENT] [--bugfix] [--enhancement]
    12                   [--newpackage] [--security] [--advisory ADVISORY] [--bz BUGZILLA]
    13                   [--cve CVES] [--sec-severity {Critical,Important,Moderate,Low}]
    14                   [--forcearch ARCH] [--duplicates | --oldinstallonly]
    15                   [PACKAGE ...]
    

    Here only the options in line 14 (and 15) are specific to this command, all the previous ones are General DNF options.

    I propose that this usage message should be simplified by replacing those general option listing with [<general-option> ...]. e.g.

     1  usage: dnf remove [<general-option> ...] [--forcearch ARCH] [--duplicates | --oldinstallonly]
     2                    [PACKAGE ...]
    

    I hope this (along with removing help message for general options on dnf help <command> https://github.com/rpm-software-management/dnf/issues/1869) will make reading command specific usage meesage and help message much better (tidy) experience.

    opened by esdnm 0
  • dnf help: Do not include is supplied">

    dnf help: Do not include "General DNF options" when is supplied

    The manpage says,

    If given a command name then only displays help for that particular command

    Although it provide help for a <command>, but by including "General DNF options" in the output of all dnf help <command>, it clutters the output.

    I propose that "General DNF options" should not be included in the output of dnf help <command>

    opened by esdnm 0
  • Incorrect dependencies handling (Recommends)

    Incorrect dependencies handling (Recommends)

    I can only test this problem with the following setup, so I don't know if it's still applicable in the trunk version:

    • Redhat/Alma/Rocky 8 (with latest updates as of today)
    • RPM 4.14.3 (Release 24)
    • dnf 4.7.0 (Release 11)

    I created a RPM containing "Recommends: dnf-automatic". When installing this RPM, it doesn't install dnf-automatic. Same with policycoreutils-python-utils.

    If I use "Requires: dnf-automatic", it's installed correctly.

    Is this a known issue (I don't see anything in github). Anything I could do to troubleshoot that? Thanks a lot.

    opened by marcstern 2
  • ImportError: No module named libdnf.transaction

    ImportError: No module named libdnf.transaction

    Dear all, I have a broken pre-installed dnf such that whenever I write dnf on commandline, I get ModuleNotFoundError: No module named 'libdnf'. That's because I installed python3.8.15 from source with --prefix=/usr. So I tried building dnf from source. Build does not give me any error. But when I execute installed binary from dnf/bin/dnf-2, I get following error:

    Traceback (most recent call last):
      File "./dnf-2", line 57, in <module>
        from dnf.cli import main
      File "/root/dnf/dnf/__init__.py", line 31, in <module>
        import dnf.base
      File "/root/dnf/dnf/base.py", line 27, in <module>
        import libdnf.transaction
    ImportError: No module named libdnf.transaction
    

    My specifications are as follows: Architecture: riscv64 (I am using hifive unleashed board from sifive). Distro: Fedora Rawhide

    opened by alitariq4589 0
Releases(4.14.0)
  • 4.14.0(Sep 9, 2022)

    What's Changed

    • doc: Describe how gpg keys are stored for repo_ggpcheck (RhBug:2020678) by @kontura in https://github.com/rpm-software-management/dnf/pull/1833
    • Set default value for variable to prevent crash (RhBug:2091636) by @j-mracek in https://github.com/rpm-software-management/dnf/pull/1834
    • Remove union with latest installed from upgrade selector (RhBug:2097757) by @kontura in https://github.com/rpm-software-management/dnf/pull/1832
    • Don't include resolved advisories for obsoletes with sec. filters (RhBug:2101421) by @kontura in https://github.com/rpm-software-management/dnf/pull/1835
    • Allow passing plugin parameters with dashes in names by @jan-kolarik in https://github.com/rpm-software-management/dnf/pull/1839
    • Fix upgrade from file to noarch pkg (RhBug:2006018) by @inknos in https://github.com/rpm-software-management/dnf/pull/1840
    • Expose plugin unload method to API (RhBug:2047251) by @jan-kolarik in https://github.com/rpm-software-management/dnf/pull/1843
    • Add support for group upgrade rollback (RhBug:2016070) by @jan-kolarik in https://github.com/rpm-software-management/dnf/pull/1844
    • Fix broken dependencies error reporting (RhBug:2088422) by @jan-kolarik in https://github.com/rpm-software-management/dnf/pull/1847
    • Add doc related to --destdir and --downloadonly options (RhBug:2100811) by @jan-kolarik in https://github.com/rpm-software-management/dnf/pull/1850

    New Contributors

    • @jan-kolarik made their first contribution in https://github.com/rpm-software-management/dnf/pull/1839

    Full Changelog: https://github.com/rpm-software-management/dnf/compare/4.13.0...4.14.0

    Source code(tar.gz)
    Source code(zip)
  • 4.13.0(May 30, 2022)

    What's Changed

    • bash-completion: use sqlite cache when available (BZ: 1815895) by @rjarry in https://github.com/rpm-software-management/dnf/pull/1817
    • force garbage collection on dnf.Base.reset() by @lersek in https://github.com/rpm-software-management/dnf/pull/1825
    • Don't use undocumented re.template() by @hroncok in https://github.com/rpm-software-management/dnf/pull/1827
    • Small change to better present the option by @plenusredemptio in https://github.com/rpm-software-management/dnf/pull/1828

    New Contributors

    • @rjarry made their first contribution in https://github.com/rpm-software-management/dnf/pull/1817
    • @lersek made their first contribution in https://github.com/rpm-software-management/dnf/pull/1825
    • @plenusredemptio made their first contribution in https://github.com/rpm-software-management/dnf/pull/1828

    Full Changelog: https://github.com/rpm-software-management/dnf/compare/4.12.0...4.13.0

    Source code(tar.gz)
    Source code(zip)
  • 4.12.0(Apr 27, 2022)

    What's Changed

    • Fix processing of download errors (RhBug: 2024527) by @m-blaha in https://github.com/rpm-software-management/dnf/pull/1818
    • dnf.conf: hint users where to find more info about defaults and other… by @xsuchy in https://github.com/rpm-software-management/dnf/pull/1820
    • Fix unittests that relied on checksum being at the end of solvfiles by @kontura in https://github.com/rpm-software-management/dnf/pull/1816
    • bash-completion: remove unnecessary sub-shelling by @ersen0 in https://github.com/rpm-software-management/dnf/pull/1822
    • Fix remove when no repos are enabled (RhBz:2064341) by @inknos in https://github.com/rpm-software-management/dnf/pull/1819
    • Add loongarch support for dnf by @zhangwenlong8911 in https://github.com/rpm-software-management/dnf/pull/1805
    • Add spaces between words to fix typos (RhBug: 2077296) by @kontura in https://github.com/rpm-software-management/dnf/pull/1826
    • [doc] Improve "proxy" configuration option documentation (RhBug:2072332) by @jrohel in https://github.com/rpm-software-management/dnf/pull/1824

    New Contributors

    • @zhangwenlong8911 made their first contribution in https://github.com/rpm-software-management/dnf/pull/1805

    Full Changelog: https://github.com/rpm-software-management/dnf/compare/4.11.1...4.12.0

    Source code(tar.gz)
    Source code(zip)
  • 4.0.9.1(Dec 17, 2018)

  • 2.7.5-modularity-6(May 23, 2018)

  • 2.7.5-modularity-5(May 2, 2018)

  • 2.7.5-modularity-4(Apr 17, 2018)

  • 2.7.5-modularity-3(Mar 26, 2018)

  • 2.7.5-modularity-2(Mar 26, 2018)

  • 2.7.5-modularity(Feb 12, 2018)

Owner
null
Easy to use, fast, git sourced based, C/C++ package manager.

Yet Another C/C++ Package Manager Easy to use, fast, git sourced based, C/C++ package manager. Features No need to install a program, just include the

null 31 Dec 21, 2022
OS-agnostic, system-level binary package manager and ecosystem

Conda is a cross-platform, language-agnostic binary package manager. It is the package manager used by Anaconda installations, but it may be used for

Conda 5.1k Dec 30, 2022
OS-agnostic, system-level binary package manager and ecosystem

Conda is a cross-platform, language-agnostic binary package manager. It is the package manager used by Anaconda installations, but it may be used for

Conda 5.1k Jan 7, 2023
A flexible package manager that supports multiple versions, configurations, platforms, and compilers.

Spack Spack is a multi-platform package manager that builds and installs multiple versions and configurations of software. It works on Linux, macOS, a

Spack 3.1k Jan 9, 2023
The Fast Cross-Platform Package Manager

The Fast Cross-Platform Package Manager part of mamba-org Package Manager mamba Package Server quetz Package Builder boa mamba Mamba is a reimplementa

Mamba 4k Dec 30, 2022
Conan - The open-source C/C++ package manager

Conan Decentralized, open-source (MIT), C/C++ package manager. Homepage: https://conan.io/ Github: https://github.com/conan-io/conan Docs: https://doc

Conan.io 6.5k Jan 5, 2023
The delightful package manager for AppImages

⚡️ Zap The delightful package manager for AppImages Report bug · Request feature Looking for the older Zap v1 (Python) implementation? Head over to v1

Srevin Saju 368 Jan 4, 2023
Dotpkg - Package manager for your dotfiles

Dotpkg A package manager for your dotfiles. Usage First make sure to have Python

FW 4 Mar 18, 2022
:package: :fire: Python project management. Manage packages: convert between formats, lock, install, resolve, isolate, test, build graph, show outdated, audit. Manage venvs, build package, bump version.

THE PROJECT IS ARCHIVED Forks: https://github.com/orsinium/forks DepHell -- project management for Python. Why it is better than all other tools: Form

DepHell 1.7k Dec 30, 2022
A software manager for easy development and distribution of Python code

Piper A software manager for easy development and distribution of Python code. The main features that Piper adds to Python are: Support for large-scal

null 13 Nov 22, 2022
Workon - A simple project manager for conda, windows 10 and vscode

WORK ON A simple project manager for conda, windows 10 and vscode Installation p

Jesus Alan Hernandez Galvan 1 Jan 16, 2022
Example for how to package a Python library based on Cython.

Cython sample module This project is an example of a module that can be built using Cython. It is an upgrade from a similar model developed by Arin Kh

Juan José García Ripoll 4 Aug 28, 2022
The Python Package Index

Warehouse Warehouse is the software that powers PyPI. See our development roadmap, documentation, and architectural overview. Getting Started You can

Python Packaging Authority 3.1k Jan 1, 2023
The Python package installer

pip - The Python Package Installer pip is the package installer for Python. You can use pip to install packages from the Python Package Index and othe

Python Packaging Authority 8.4k Dec 30, 2022
A Poetry plugin for dynamically extracting the package version.

Poetry Version Plugin A Poetry plugin for dynamically extracting the package version. It can read the version from a file __init__.py with: # __init__

Sebastián Ramírez 264 Dec 22, 2022
PokerFace is a Python package for various poker tools.

PokerFace is a Python package for various poker tools. The following features are present in PokerFace... Types for cards and their componen

Juho Kim 21 Dec 29, 2022
pipreqs - Generate pip requirements.txt file based on imports of any project. Looking for maintainers to move this project forward.

pipreqs - Generate requirements.txt file for any project based on imports Installation pip install pipreqs Usage Usage: pipreqs [options] <path>

Vadim Kravcenko 4.8k Dec 31, 2022
Python dependency management and packaging made easy.

Poetry: Dependency Management for Python Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right sta

Poetry 23.1k Jan 1, 2023
Python PyPi staging server and packaging, testing, release tool

devpi: PyPI server and packaging/testing/release tool This repository contains three packages comprising the core devpi system on the server and clien

null 629 Jan 1, 2023