Bug 1665636 - dnf history userinstalled doesn't account packages which are installed after question if it should be installed
Summary: dnf history userinstalled doesn't account packages which are installed after ...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 29
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Daniel Mach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-12 01:05 UTC by Harald H.
Modified: 2019-11-27 16:12 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-27 16:05:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Harald H. 2019-01-12 01:05:30 UTC
Not a bug, more a improvement/inconsistent behaviour

Steps to Reproduce:
1. type a command which doesn't exist on this computer in terminal, for example "xssstate"
2. fedora says the command isn't available but it could install the according package
3. User types "y" to install the package
4. User executes "dnf history userinstalled" after the package-install

Actual results:
the package isn't shown in userinstalled

Expected results:
even if these are different forms of installing a package, I would expect that the package is marked as "userinstalled" since I did an active decision on saying "y" to the package. Don't know how difficult this may be, maybe this kind of install hasn't even something to do with dnf, but from a user perspective it would be the preferred behaviour.

Thanks!

Comment 2 Daniel Mach 2019-08-16 15:24:01 UTC
The root cause is that PackageKit-command-not-found stores "UNKNOWN" reason in the history database for the installed package.
On the other hand, DNF should consider packages without known reason as user-installed.

Since PK has inactive upstream, I decided to fix it on our end:
PR: https://github.com/rpm-software-management/dnf/pull/1460

Comment 3 Ben Cotton 2019-10-31 18:57:04 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
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
Fedora 'version' of '29'.

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

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ihor 2019-11-22 16:50:19 UTC
Hello Daniel.

Is it correct that your patch is marking all packages during regular dnf upgrade as user installed?

Comment 5 Daniel Mach 2019-11-27 16:05:11 UTC
Ihor,
I believe the solution is correct to certain extent.

The problem comes from a PackageKit plugin
that stores UNKNOWN reason to the database.

For safety reason, my patch considers such packages as USERINSTALLED,
because they shouldn't be removed during autoremove.

So the patch is not marking anything in the database,
it's only interpreting the reason of package installation.
And I believe it's doing the right thing.

In the meantime, the patch got merged and was released (not sure about F29, but it's part of newer Fedoras).
If you find the behavior incorrect on F30+, please open a new bug and we'll look into that.

Comment 6 Ihor 2019-11-27 16:12:07 UTC
Sorry Daniel,

I realized that a lot of packages marked as user installed with dnf system-upgrade plugin. But had no time to write here a comment to skip my question.


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