Skip to content

RFE: More useful keepcache options #2534

@genodeftest

Description

@genodeftest

Current dnf version: dnf5-5.2.17.0-2.fc43.x86_64

The current options of keepcache are only:

  • True =keep everything always and forever
    • This will lead to ever accumulating pile of packages in the cache
    • This is not practical for any use cases where a high level of automation is intended, as one needs to call dnf clean […] on a regular basis
  • False =delete cache after every successful transaction
    • If I understand this correctly, this will in some scenarios delete the already downloaded updates without installing them¹
    • This is not practical for people who often up-/downgrade packages over a low bandwidth connection.
    • My main reason for keeping cache is that I want to be able to downgrade recently updated packages to the previous version in case the update broke things like NetworkManager that would be relatively cumbersome to fix otherwise.

Most people probably don't want any of those extremes. Wouldn't it make sense to modify the caching behavior instead to keep at most 2 versions of a package in cache? This way, there would always be a package to downgrade to for a while. Of course this will break at some point, but there are probably very few or no users who are interested in keeping all versions of all packages they ever had installed.

So how about adding two more useful options:

  • 1: Keep one version (usually the currently installed version) of each package in cache
  • 2: Keep the two latest version in cache, usually the latest version and the version it was updated from

¹ Example scenario:

  1. You have automatic download of updates enabled, but keepcache=False (the default)
  2. Your machine is downloading the updates
  3. Before the updates get installed, the user manually executes any dnf transaction (install/uninstall/…)
  4. At the end of the manual transaction, the updates downloaded in step 2. get deleted
  5. Machine needs to download the updates again

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions