Bug 1241217 - dnf lacks a method to merely download updates
Summary: dnf lacks a method to merely download updates
Keywords:
Status: CLOSED DUPLICATE of bug 1048433
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-08 18:26 UTC by Chris Siebenmann
Modified: 2015-07-10 13:12 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-10 13:08:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1048433 0 unspecified CLOSED RFE --downloadonly 2021-02-22 00:41:40 UTC

Internal Links: 1048433

Description Chris Siebenmann 2015-07-08 18:26:04 UTC
Description of problem:

DNF lacks enough functionality to be able to easily download updates
but not apply them, as 'yum update --downloadonly' used to be able to
do. 'dnf upgrade' no longer has '--downloadonly', and 'dnf download'
requires an explicit package list.

There are some updates and update situations where the system or parts
of it will be unstable and problematic during the update (for example,
I've had problems when updating Firefox while it was running). As a
result, you want to shut down parts of the system during the update.
In Yum, you could minimize the downtime by doing the update in two
stages:
	yum update --downloadonly
[wait while things slowly fetched over your network, then close
 the apps/etc that you needed to]
	yum update

There is no good equivalent in dnf; the best you can do is use 'dnf list
upgrades' or 'dnf check-update' to generate a list (and post-process it
to get just package names and architecture), 'dnf download <big list>' to
download them all to some directory, and then 'dnf upgrade *.rpm'. Among
other issues, I'm not sure that this is exactly equivalent because I
don't know if it properly handles packages like the kernel.

(It also won't save the downloaded packages through the 'local'
plugin if you have that configured.)

Due to all of these issues, I feel that 'dnf upgrade' should support
some 'stop after the package fetch stage' switch. I'm not attached
to it being '--downloadonly', eg if you feel that the semantics would
be sufficiently different from the yum version to call for a different
name.

(My personal view is that enhancing the 'dnf download' plugin to do all
of what 'dnf upgrade --downloadonly' would/should do is too much work,
given the dnf local plugin.)

Another usage case for me is doing yum Fedora version upgrades in two
steps; first download the packages (which needs little attention but can
take quite a while on many Internet connections), then later start the
upgrade (which destabilizes the system and must be watched carefully).

(I don't consider this a duplicate of eg bug 1203491 because I believe
my usage case and thus the feature I want is different from theirs.
This also may interact with eg bug 1220074 .)

Comment 1 Radek Holy 2015-07-09 10:32:23 UTC
Hello, what about dnf-automatic? I know that in your case, the name is not very intuitive but I believe that it provides everything you need.

Comment 2 Chris Siebenmann 2015-07-09 12:36:56 UTC
dnf-automatic appears to lacks an equivalent to --releasever, which is
important for the case of upgrading Fedora versions via yum/dnf (where
I want to do the dnf equivalent of 'yum --releasever N --downloadonly
distro-sync').

(When I filed this originally, I forgot that 'yum upgrade' wasn't
the only case for --downloadonly; distro-sync needs it too.)

In general dnf-automatic feels like an awkward way to get this.
For what used to be a straightforward use-any-time command line
option, you now have to set up a configuration file and then run
dnf-automatic by hand. You also don't get any selectivity about
what packages to download; in past versions of Fedora I've not
infrequently done:

	yum upgrade --downloadonly <annoying-package>
[stop whatever necessary thing]
	yum upgrade <annoying-package>

to just do this split processing for a single annoying package
even when there are updates to multiple packages pending. And
of course this means you can't do the equivalent of eg:

	yum upgrade --downloadonly --exclude 'kernel*'
	yum upgrade --exclude 'kernel*'

With dnf-automatic in this scenario, at a minimum you're going
to download and then throw away the excluded packages (dnf-automatic
will download them, you'll do 'dnf upgrade --exclude ...', and then
either they'll get auto-deleted or you'll purge them).

Given that the actual code seems likely to be small (given how small
dnf-automatic's Python code is itself), I really think that upgrade
and distro-sync should just regain the '--downloadonly' option or an
equivalent. It's the simplest way to cover a lot of usage cases and
interactions with other plugins and so on.

Comment 3 Radek Holy 2015-07-09 12:45:52 UTC
I agree with everything you said. Also I can imagine one would want to perform "dnf --downloadonly downgrade foo" or "dnf --downloadonly install foo".

Comment 4 Chris Siebenmann 2015-07-09 14:39:12 UTC
Yes, that's a good point about downgrade; that can have the same sort of
instability issues. And one might as well cover install as well just in
case (I'm sure someone's using it).

Comment 5 Radek Holy 2015-07-10 13:08:20 UTC
Let me track the request in the bug 1048433 where the --downloadonly switch was requested first. Both of you want to download the packages in advance. You will install them on the same machine then while Frank on another one but from the DNF's POV it is essentially the same.

*** This bug has been marked as a duplicate of bug 1048433 ***


Note You need to log in before you can comment on or make changes to this bug.