Bug 2080334

Summary: dnf deletes packages downloaded using --downloadonly even if different --downloaddir is provided
Product: [Fedora] Fedora Reporter: Pavla Kratochvilova <pkratoch>
Component: dnfAssignee: rpm-software-management
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 38CC: amatej, daniel.mach, jmracek, jrohel, mblaha, mhatina, packaging-team-maint, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-24 14:38:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavla Kratochvilova 2022-04-29 13:21:12 UTC
When I download packages using the dnf options `--downloadonly`, the packages are deleted before the next transaction. This is probably expected, but users use this to download packages for other purposes than transaction (together with `--downloaddir`) and then may be surprised that the packages get deleted.


Steps to Reproduce:
1. # mkdir repo1
2. # dnf reinstall --downloaddir repo1/ --downloadonly bash -y
3. # ls repo1
bash-5.1.0-2.fc34.x86_64.rpm
4. # dnf -y install createrepo
5. # ls repo1
<empty>


The workaround is to use the `download` plugin.
Btw, other files in the downloaddir are unchanged.

Comment 1 Ben Cotton 2022-11-29 18:50:38 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 2 Ben Cotton 2023-02-07 14:53:02 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 3 Jaroslav Mracek 2023-08-24 14:38:13 UTC
The issue is fixed in DNF5. We cannot change the behavior in DNF, because it will create a regression in related tools.