Bug 1039415

Summary: "dnf history userinstalled"dosen't work
Product: [Fedora] Fedora Reporter: lnie <lnie>
Component: dnfAssignee: Radek Holy <rholy>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: akozumpl, jzeleny, lnie, packaging-team-maint, pnemade, rholy, rhughes
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-17 13:49:51 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:
Attachments:
Description Flags
screenshot
none
screenshot
none
dnf4
none
yum
none
dnf
none
dnfy
none
no /var/liv
none
history,you can see,I do install libvirt using dnf
none
I dnf install abrt-cli,and do 'clean dbcache',then'dnf history userinstalled',after a long while ,there is no abrt-cli in the output
none
history-*.sqlite none

Description lnie 2013-12-09 04:05:48 UTC
Description of problem:
want to see the installed packages using "dnf history userinstalled",
but it dosen't work
 
Version-Release number of selected component (if applicable):
dnf-0.4.9-1.fc20
How reproducible:
always

Steps to Reproduce:
1.install dnf
2.dnf install xchat and libvirt 
3.run "dnf history userinstalled"

Actual results:
No packages to list

Expected results:

list xchat and libvirt
Additional info:

Comment 1 Radek Holy 2013-12-09 07:55:23 UTC
Thank you for the report.

Are you sure that it does not list any packages?  At least, It should list packages installed during the last command. In your case, it should list xchat and libvirt, if you have installed them with a single command, or libvirt, if you have installed xchat and then libvirt.

Comment 2 lnie 2013-12-09 08:48:31 UTC
No,I tested one more time just now,
dnf install xchat
and run dnf history userinstalled 
it show xchat is installed(actually,libvirt is installed too)
then remove libvirt,and then install libvirt again,
run dnf history userinstalled after the installation of libvirt
the output is:No packages to list

Comment 3 Radek Holy 2013-12-09 09:03:37 UTC
That's strange, I cannot reproduce it. It shows libvirt is installed here.
How did you do the last install of libvirt? "dnf install libvirt"? Or "yum install libvirt"?

Comment 4 lnie 2013-12-09 09:04:37 UTC
FYI :)

1) remove xchat, and then install it.
run dnf history userinstalled after the installation of xchat
the output is:
packages installed by user
xchat
2) dnf install virt-manager
   output of dnf history userinstalled:
   packages installed by user
   virt-manager
   then run dnf romove xchat
   the output of dnf history userinstalled:
   No packages to list
3) dnf install virt-manager
   then restart the system
   the output of dnf history userinstalled:
   No packages to list

Comment 5 lnie 2013-12-09 09:07:24 UTC
(In reply to Radek Holy from comment #3)
> That's strange, I cannot reproduce it. It shows libvirt is installed here.
> How did you do the last install of libvirt? "dnf install libvirt"? Or "yum
> install libvirt"?

dnf install libvirt,there are also something strange,I will attach the screenshot

Comment 6 lnie 2013-12-09 09:08:44 UTC
Created attachment 834233 [details]
screenshot

Comment 7 lnie 2013-12-09 09:10:33 UTC
As you can see from the screenshot,it show that the installed size is :0
when I try to dnf remove libvirt

Comment 8 lnie 2013-12-09 09:13:21 UTC
Created attachment 834234 [details]
screenshot

Comment 9 lnie 2013-12-09 09:13:49 UTC
Created attachment 834235 [details]
dnf4

Comment 10 lnie 2013-12-09 09:18:26 UTC
As you can see from the last two screenshot,when I do "dnf install virt-manager"
it says the size is :584K;when I do "dnf remove virt-manager" it says 
the size is :3.5M
ohoh~,need I open one more bug for this ?

Comment 11 Radek Holy 2013-12-09 10:06:22 UTC
(In reply to lnie from comment #4)
> 2) dnf install virt-manager
>    output of dnf history userinstalled:
>    packages installed by user
>    virt-manager
>    then run dnf romove xchat
>    the output of dnf history userinstalled:
>    No packages to list

Yes, it seems that DNF is not able to find the installation reason of packages installed before the last transaction.

(In reply to lnie from comment #4)
> 3) dnf install virt-manager
>    then restart the system
>    the output of dnf history userinstalled:
>    No packages to list

I cannot reproduce that. It shows virt-manager is installed here, even after the restart.

(In reply to lnie from comment #10)
> As you can see from the last two screenshot,when I do "dnf install
> virt-manager"
> it says the size is :584K;when I do "dnf remove virt-manager" it says 
> the size is :3.5M
> ohoh~,need I open one more bug for this ?

It seems as correct behaviour. When installing, it shows package download size. When removing, it shows installed files size. If you have a different opinion, please open a new bug.

Anyway, I am going to look at the (2). Hopefully, it will solve the (3), too.

Comment 12 lnie 2013-12-10 05:53:11 UTC
> (In reply to lnie from comment #4)
> > 3) dnf install virt-manager
> >    then restart the system
> >    the output of dnf history userinstalled:
> >    No packages to list
> 
> I cannot reproduce that. It shows virt-manager is installed here, even after
> the restart.
> 
I tested it on VM ,maybe that's the reason?

> It seems as correct behaviour. When installing, it shows package download
> size. When removing, it shows installed files size. If you have a different
> opinion, please open a new bug.
‘it show that the installed size is :0 when I try to dnf remove libvirt’
 is also supposed to be  a correct behaviour? 
 As you know,it's not a big problem,as long as the packages can be installed   and removed successfully,just feel weird.
 Or,maybe it's an error?I will attach two more screenshots.
 one is the screenshot when do 'yum install xchat'
 the other is the screenshot when do 'dnf install xchat'
 the 'Total download size' are same,while the Installed Size are different.
 It seems that the yum one is right.:)

Comment 13 lnie 2013-12-10 06:31:11 UTC
Created attachment 834645 [details]
yum

Comment 14 lnie 2013-12-10 06:31:38 UTC
Created attachment 834646 [details]
dnf

Comment 15 Radek Holy 2013-12-10 09:03:35 UTC
(In reply to lnie from comment #12)
> I tested it on VM ,maybe that's the reason?

I also tested it on VM :-/

> ‘it show that the installed size is :0 when I try to dnf remove libvirt’
>  is also supposed to be  a correct behaviour? 

Yes, it is, because libvirt package contains no files.

>  Or,maybe it's an error?I will attach two more screenshots.
>  one is the screenshot when do 'yum install xchat'
>  the other is the screenshot when do 'dnf install xchat'
>  the 'Total download size' are same,while the Installed Size are different.
>  It seems that the yum one is right.:)

Yes, it seems like a bug. Please, open a new bug for that.

Comment 16 lnie 2013-12-11 03:24:47 UTC
> 
> Yes, it seems like a bug. Please, open a new bug for that.
  opened one #bug1040255 :)

Comment 17 Radek Holy 2013-12-12 12:33:20 UTC
It seems there is a problem with cache. After running "dnf clean dbcache", you should see all user-installed packages.

Comment 18 lnie 2013-12-13 02:50:22 UTC
(In reply to Radek Holy from comment #17)
> It seems there is a problem with cache. After running "dnf clean dbcache",
> you should see all user-installed packages.

It becomes better,after run "dnf clean dbcache".However,It still unable to put all the installed packages.
As you can see from the attachment,it only shows xchat,rsyslog installed,
while I also have installed libvirt and virt-manager using dnf.

Comment 19 lnie 2013-12-13 03:04:06 UTC
Created attachment 836100 [details]
dnfy

Comment 20 lnie 2013-12-13 03:06:25 UTC
what's worse, "dnf history userinstalled"takes several minutes before it finally shows the output

Comment 21 Radek Holy 2013-12-13 08:51:31 UTC
(In reply to lnie from comment #18)
> It becomes better,after run "dnf clean dbcache".However,It still unable to
> put all the installed packages.
> As you can see from the attachment,it only shows xchat,rsyslog installed,
> while I also have installed libvirt and virt-manager using dnf.

Well, it should list only packages, which you have installed using "dnf install" command directly (no dependencies, no packages installed by Anaconda, no packages installed by Yum). If all applies, could you please attach your "/var/liv/dnf/history/history-*.sqlite" to let me look at that?


(In reply to lnie from comment #20)
> what's worse, "dnf history userinstalled"takes several minutes before it
> finally shows the output

Do you mean after the "clean dbcache" or every time? In the first case, DNF builds the cache again which might take a while. However if any of these cases are unacceptable for you, open a new bug, please.

Comment 22 lnie 2013-12-13 09:38:03 UTC
Created attachment 836257 [details]
no /var/liv

Comment 23 lnie 2013-12-13 09:40:22 UTC
Created attachment 836258 [details]
history,you can see,I do install libvirt using dnf

Comment 24 lnie 2013-12-13 09:42:07 UTC
> Well, it should list only packages, which you have installed using "dnf
> install" command directly (no dependencies, no packages installed by
> Anaconda, no packages installed by Yum). If all applies, could you please
> attach your "/var/liv/dnf/history/history-*.sqlite" to let me look at that?
  I know it only list that packages,I'm pretty sure that I had installed libvirt and virt-manager using dnf. As you can see from the screenshot there is no /var/liv in my system.Just in case,I have dnf remove them,and dnf install them again.

Comment 25 lnie 2013-12-13 09:44:22 UTC
Created attachment 836259 [details]
I dnf install abrt-cli,and do 'clean dbcache',then'dnf history userinstalled',after a long while ,there is no abrt-cli in the output

Comment 26 lnie 2013-12-13 09:45:22 UTC
> 
> 
> (In reply to lnie from comment #20)
> > what's worse, "dnf history userinstalled"takes several minutes before it
> > finally shows the output
> 
> Do you mean after the "clean dbcache" or every time? In the first case, DNF
> builds the cache again which might take a while. However if any of these
> cases are unacceptable for you, open a new bug, please.
  after a reboot or "dnf remove",I have to 'clean dbcache'before "dnf history userinstalled" shows the better output,so...that's really buzzing

Comment 27 Radek Holy 2013-12-13 09:49:46 UTC
(In reply to lnie from comment #24)
> libvirt and virt-manager using dnf. As you can see from the screenshot there
> is no /var/liv in my system.Just in case,I have dnf remove them,and dnf
> install them again.

"/var/lib/dnf/history/history-*.sqlite" -- I am sorry for the typo.

(In reply to lnie from comment #26)
>   after a reboot or "dnf remove",I have to 'clean dbcache'before "dnf
> history userinstalled" shows the better output,so...that's really buzzing

Yes, that is just a workaround. I am working on it.

Comment 28 lnie 2013-12-16 04:28:12 UTC
Created attachment 837113 [details]
history-*.sqlite

Comment 29 Richard Hughes 2013-12-17 08:54:58 UTC
I think https://admin.fedoraproject.org/updates/libsolv-0.4.1-0.gita8e47f1.fc20 might fix this issue too.

Comment 30 Radek Holy 2013-12-17 08:59:38 UTC
Yes, I am testing it now.

Comment 31 Radek Holy 2013-12-17 11:40:28 UTC
Yes, the bug in libsolv was the cause.

Comment 32 Radek Holy 2013-12-17 13:49:51 UTC

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