Bug 1125925 - [RFE] provide a 'add to user-installed-list' command
Summary: [RFE] provide a 'add to user-installed-list' command
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Honza Silhan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1229463 (view as bug list)
Depends On:
Blocks: 1164279
TreeView+ depends on / blocked
 
Reported: 2014-08-01 11:08 UTC by Benedikt Morbach
Modified: 2015-09-23 04:12 UTC (History)
16 users (show)

Fixed In Version: 1.1.1-2.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-09 23:19:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1227949 0 unspecified CLOSED RFE: yumdb equivalent for dnf 2021-02-22 00:41:40 UTC

Internal Links: 1227949

Description Benedikt Morbach 2014-08-01 11:08:25 UTC
Please provide a dnf command to add a package to the list of explicitly user-installed packages.

Sometimes a package gets installed as a dependency but you end up using it.
Later it becomes unused and 'dnf erase' wants to remove it.
There should be a way to add it to the list of user-installed packages to prevent that.

Comment 1 Honza Silhan 2014-08-01 13:01:41 UTC
Thanks for the report. Rather than create a new command we could add `install` command behavior that would mark them as user installed in case they are already on the system.

Comment 3 Radek Holy 2015-06-09 07:19:08 UTC
*** Bug 1229463 has been marked as a duplicate of this bug. ***

Comment 4 Michael Mráka 2015-06-09 12:20:57 UTC
As of now the workaround is to reinstall the package - it will mark it as user-installed.

E.g.
# dnf install quicksynergy
Last metadata expiration check performed 2:22:12 ago on Tue Jun  9 11:48:48 2015.
Dependencies resolved.
==========================================================================================================
 Package                           Arch              Version                      Repository         Size
==========================================================================================================
Installing:
 avahi-compat-libdns_sd            x86_64            0.6.31-30.fc22               fedora             23 k
 cryptopp                          x86_64            5.6.2-6.fc22                 fedora            1.0 M
 quicksynergy                      x86_64            0.8.1-12.fc22                fedora             36 k
 synergy                           x86_64            1.6.2-1.fc22                 fedora            746 k

Transaction Summary
==========================================================================================================
Install  4 Packages
...
Complete!

# dnf remove quicksynergy
Dependencies resolved.
==========================================================================================================
 Package                            Arch              Version                    Repository          Size
==========================================================================================================
Removing:
 aajohan-comfortaa-fonts            noarch            2.004-4.fc22               @System            515 k
 avahi-compat-libdns_sd             x86_64            0.6.31-30.fc22             @System             35 k
 cryptopp                           x86_64            5.6.2-6.fc22               @System            4.6 M
 quicksynergy                       x86_64            0.8.1-12.fc22              @System             80 k
 synergy                            x86_64            1.6.2-1.fc22               @System            3.0 M

Transaction Summary
==========================================================================================================
Remove  5 Packages

Installed size: 8.2 M
Is this ok [y/N]: n
Operation aborted.

# dnf reinstall synergy
Last metadata expiration check performed 2:23:16 ago on Tue Jun  9 11:48:48 2015.
Dependencies resolved.
==========================================================================================================
 Package                 Arch                   Version                      Repository              Size
==========================================================================================================
Reinstalling:
 synergy                 x86_64                 1.6.2-1.fc22                 fedora                 746 k

Transaction Summary
==========================================================================================================
...
Reinstalled:
  synergy.x86_64 1.6.2-1.fc22                                                                             

Installed products updated.
Complete!

# dnf remove quicksynergy
Dependencies resolved.
==========================================================================================================
 Package                            Arch              Version                    Repository          Size
==========================================================================================================
Removing:
 aajohan-comfortaa-fonts            noarch            2.004-4.fc22               @System            515 k
 quicksynergy                       x86_64            0.8.1-12.fc22              @System             80 k

Transaction Summary
==========================================================================================================
Remove  2 Packages
...
Removed:
  aajohan-comfortaa-fonts.noarch 2.004-4.fc22              quicksynergy.x86_64 0.8.1-12.fc22             

Installed products updated.
Complete!

# rpm -q synergy
synergy-1.6.2-1.fc22.x86_64

Comment 5 Radek Holy 2015-06-09 12:28:00 UTC
(In reply to Michael Mráka from comment #4)
> it will mark it as user-installed.

No, this is not true.

Comment 6 Havner 2015-06-25 10:10:46 UTC
(In reply to Radek Holy from comment #5)
> (In reply to Michael Mráka from comment #4)
> > it will mark it as user-installed.
> 
> No, this is not true.

Exactly, it will not mark it as such. I stumbled upon it expecting it will. But I think it really shouldn't. We might want to reinstall a 'reason dep' package for various of reasons and it shouldn't get marked 'reason user'. There should be an explicit operation for it (as well as an opposite one, to unmark it from user-installed).

Comment 7 Petr Pisar 2015-08-25 11:49:55 UTC
Would be possible to introduce an option to "dnf install" and "dnf builddep"
command not to mark the top-level packages as implicitly installed? For example
Gentoo's portage calles this option "--oneshot" or "-1".

Use case: I want to build foo.spec, so I do "dnf builddep foo.spec". Now
I will have to run "dnf mark remove
LIST_OF_ALL_THE_DIRECT_DEPENDENCIES_REQUIRES_BY_foo.spec" (and then "dnf autoremove" in the future). With the option I would do "dnf -1 builddep foo.spec" and that's would be all.

This option would allow temporary package installation without polluting the system forever.

Comment 8 Fedora Update System 2015-09-01 09:51:46 UTC
dnf-plugins-core-0.1.11-1.fc23 dnf-1.1.1-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14743

Comment 9 Havner 2015-09-01 13:02:06 UTC
I just tested the new mark command. Seemed to work fine.

Is there a way to list packages marked either way?

Comment 10 Fedora Update System 2015-09-01 20:22:30 UTC
dnf-1.1.1-1.fc23, dnf-plugins-core-0.1.11-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update dnf dnf-plugins-core'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14743

Comment 11 Radek Holy 2015-09-02 15:49:10 UTC
dnf history userinstalled
    List names of all packages installed by a user.

source: http://dnf.readthedocs.org/en/latest/command_ref.html

Comment 12 Havner 2015-09-02 15:54:24 UTC
Thank you. I kinda assumed that it works on the logs to show which packages were really installed and not marked later on (I've seen something like this with yum I think). But it indeed does work properly.

I'm content with DNF now.

Comment 13 Fedora Update System 2015-09-08 12:38:35 UTC
dnf-1.1.1-2.fc22 dnf-plugins-core-0.1.11-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14744

Comment 14 Fedora Update System 2015-09-08 12:38:52 UTC
dnf-1.1.1-2.fc22 dnf-plugins-core-0.1.11-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14744

Comment 15 Fedora Update System 2015-09-08 12:39:53 UTC
dnf-1.1.1-2.fc23 dnf-plugins-core-0.1.11-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14743

Comment 16 Fedora Update System 2015-09-08 17:51:52 UTC
dnf-1.1.1-2.fc23, dnf-plugins-core-0.1.11-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update dnf dnf-plugins-core'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14743

Comment 17 Fedora Update System 2015-09-08 21:26:12 UTC
dnf-1.1.1-2.fc22, dnf-plugins-core-0.1.11-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update dnf-plugins-core dnf'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14744

Comment 18 Fedora Update System 2015-09-09 23:18:51 UTC
dnf-1.1.1-2.fc22, dnf-plugins-core-0.1.11-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2015-09-23 04:12:00 UTC
dnf-1.1.1-2.fc23, dnf-plugins-core-0.1.11-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


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