Bug 1227924 - "dnf upgrade" does not upgrade all the packages listed by "dnf list upgrades"
Summary: "dnf upgrade" does not upgrade all the packages listed by "dnf list upgrades"
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1239236 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-03 20:37 UTC by stan
Modified: 2015-07-07 14:12 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-06-04 09:41:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1210445 0 low CLOSED [rfe] report when skipping available updates due to dependency reasons 2021-02-22 00:41:40 UTC

Internal Links: 1210445

Description stan 2015-06-03 20:37:15 UTC
Description of problem:
To avoid issues with broken dependencies, I usually run  dnf-3 list upgrades > upgrades  as a command, and then run a python program to schedule a subprocess for each of the packages needing an upgrade.  I remove any upgraded packages from the list.  So I did this, and dnf-3 gave me a bunch of packages that had upgrades.  But when I run the program, or even from the command line, dnf-3 tells me there is nothing to do.

Version-Release number of selected component (if applicable):
$ rpm -qi python3-dnf
Name        : python3-dnf
Version     : 1.0.0
Release     : 1.fc23
Architecture: noarch


How reproducible:
On the packages that fail, every time.  But some packages, in fact most, seem to succeed.

Steps to Reproduce:
1.  Run a dnf-3 upgrade in rawhide to clear out successful packages.
2.  Set debuglevel to 10 in dnf.conf.
3.  Then run dnf-3 list upgrades > upgrades
4.  Pick a package from the list in upgrades and run the command
dnf-3 -y -v upgrade [package name]

Actual results:
# dnf-3 -y -v upgrade audacious
cachedir: /var/cache/dnf/x86_64/23
Loaded plugins: download, reposync, noroot, config-manager, Query, generate_completion_cache, copr, needs-restarting, protected_packages, repograph, repoclosure, builddep, playground, local, debuginfo-install, snapper, repomanage, tracer
DNF version: 1.0.0
repo: using cache for: rawhide
not found updateinfo for: Fedora - Rawhide - Developmental packages for the next Fedora release
rawhide: using metadata from Wed Jun  3 13:00:35 2015.
Last metadata expiration check performed 0:29:20 ago on Wed Jun  3 13:00:35 2015.
--> Starting dependency resolution
--> Finished dependency resolution
Dependencies resolved.
Nothing to do.
Completion plugin: Generating completion cache...
snapper: creating snapshot
snapper: creating snapshot failed: error.unknown_config: org.freedesktop.DBus.Error.Failed
You should restart:
  Nothing needs to be restarted
Complete!

Expected results:
audacious upgrades.

Additional info:
This is the version currently installed.
# rpm -qi audacious
Name        : audacious
Version     : 3.5.2
Release     : 1.fc21
Architecture: x86_64
Install Date: Sun 11 Jan 2015 10:29:25 AM MST

This is the upgraded package available in rawhide.
# dnf-3 list available audacious                                                                                                                                                                                                              
timer: config: 6 ms                                                                                                                                                                                                                           
cachedir: /var/cache/dnf/x86_64/23                                                                                                                                                                                                            
Loaded plugins: config-manager, repograph, reposync, copr, generate_completion_cache, debuginfo-install, tracer, playground, download, local, needs-restarting, noroot, repomanage, builddep, Query, protected_packages, repoclosure, snapper 
DNF version: 1.0.0                                                                                                                                                                                                                            
Command: dnf                                                                                                                                                                                                                                  
Installroot: /                                                                                                                                                                                                                                
Releasever: 23                                                                                                                                                                                                                                
Base command: list                                                                                                                                                                                                                            
Extra commands: ['available', 'audacious']                                                                                                                                                                                                    
repo: using cache for: rawhide                                                                                                                                                                                                                
not found updateinfo for: Fedora - Rawhide - Developmental packages for the next Fedora release                                                                                                                                               
timer: sack setup: 206 ms                                                                                                                                                                                                                     
rawhide: using metadata from Wed Jun  3 13:00:35 2015.
Last metadata expiration check performed 0:31:17 ago on Wed Jun  3 13:00:35 2015.
Available Packages
audacious.x86_64                                                                                                     3.6.2-1.fc23                                                                                                      rawhide
Cleaning up.


Sorry for the bad wrapping.

Comment 1 Radek Holy 2015-06-04 09:41:45 UTC
Hello, the problem is that (like in the "dnf check-update" command) the fact that an update is available does not mean that the upgrade can be installed. It happens often e.g. when the dependencies of the update are not available yet. Especially in Rawhide. Since the "upgrade" command installs only those updates that *can* be installed (as documented), the reported behaviour is not a bug. See also http://dnf.readthedocs.org/en/latest/user_faq.html#why-are-dnf-check-update-packages-not-marked-for-upgrade-in-the-following-dnf-upgrade (the "list upgrades" command behaves the as the "check-update" command in this regard).

To get the list of the updates that *can* be installed, you need to run "dnf upgrade". To see the dependency problems, you need to run "dnf --best upgrade".

BTW, since you are already using Python in your workflow, I recommend you using our Python API.

FYI, see also bug 1210445.

Comment 2 Radek Holy 2015-06-04 09:44:41 UTC
(In reply to Radek Holy from comment #1)
> BTW, since you are already using Python in your workflow, I recommend you
> using our Python API.
...because parsing an output in an undocumented format is not very reliable solution.

Comment 3 stan 2015-06-04 14:50:30 UTC
Thanks for your response.  And the pointer to the other bugzilla.  This is obviously a duplicate of the concern expressed there.  
Perhaps, rather than saying 
  dependencies resolved
  nothing to do
dnf-3 could say
  dependencies resolved
  needed dependency not available.  See --best option.
in this case.  That is, it doesn't give the dependency chain like yum, but does indicate that it is a dependency problem.  And a pointer to how to track it down.

But, with the information you've provided, I can add --best always so that I see this anyway.  

Whoa!  With the Python API I can create my own replacement for dnf.  It turns dnf into a library.  With a quick peruse, I didn't see how to determine if the package actually upgraded with a call, but I'll look further into creating a custom solution using it.  The next time the flow breaks.  Lazy evaluation.  'Why should I fix the roof, on such a sunny day?'  :-)

Comment 4 Honza Silhan 2015-07-07 14:12:27 UTC
*** Bug 1239236 has been marked as a duplicate of this bug. ***


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