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.
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.
*** Bug 1229463 has been marked as a duplicate of this bug. ***
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
(In reply to Michael Mráka from comment #4) > it will mark it as user-installed. No, this is not true.
(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).
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.
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
I just tested the new mark command. Seemed to work fine. Is there a way to list packages marked either way?
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
dnf history userinstalled List names of all packages installed by a user. source: http://dnf.readthedocs.org/en/latest/command_ref.html
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.
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
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
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
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
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.
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.