This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1125925 - [RFE] provide a 'add to user-installed-list' command
[RFE] provide a 'add to user-installed-list' command
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
21
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Honza Silhan
Fedora Extras Quality Assurance
:
: 1229463 (view as bug list)
Depends On:
Blocks: 1164279
  Show dependency treegraph
 
Reported: 2014-08-01 07:08 EDT by Benedikt Morbach
Modified: 2015-09-23 00:12 EDT (History)
16 users (show)

See Also:
Fixed In Version: 1.1.1-2.fc23
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-09-09 19:19:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Benedikt Morbach 2014-08-01 07:08:25 EDT
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 09:01:41 EDT
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 03:19:08 EDT
*** Bug 1229463 has been marked as a duplicate of this bug. ***
Comment 4 Michael Mráka 2015-06-09 08:20:57 EDT
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 08:28:00 EDT
(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 06:10:46 EDT
(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 07:49:55 EDT
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 05:51:46 EDT
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 09:02:06 EDT
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 16:22:30 EDT
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 11:49:10 EDT
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 11:54:24 EDT
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 08:38:35 EDT
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 08:38:52 EDT
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 08:39:53 EDT
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 13:51:52 EDT
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 17:26:12 EDT
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 19:18:51 EDT
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 00:12:00 EDT
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.