Bug 1278124 - RFE: Add new option to repoquery - user-installed
Summary: RFE: Add new option to repoquery - user-installed
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Jaroslav Rohel
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2015-11-04 17:25 UTC by Matthew Miller
Modified: 2017-05-14 20:19 UTC (History)
8 users (show)

Fixed In Version: dnf-2.4.1-1.fc26
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2017-05-14 20:19:35 UTC

Attachments (Terms of Use)

Description Matthew Miller 2015-11-04 17:25:15 UTC
I frequently hear requests to produce a list of all user-installed packages (as opposed to those installed by default or brought in by dependencies.) For example, this question on Unix & Linux Stack Exchange: http://unix.stackexchange.com/q/16527/2511

DNF actually tracks this information, and the list can be manipulated with the "dnf mark" command (either "install" or "remove"). However, as far as I can see, there's no way for a user to get a list. It would be nice to have

  dnf list marked

to do this. (Or possibly "dnf list userinstalled", as "marked" isn't completely obvious... but on the other hand, at least "marked" is consistent.)

Or, alternately, this could be

  dnf list mark

I don't strongly care, but the functionality would be great. :)

As a bonus, it would be nice to be able to easily format the output as a list of just package names, with no versions. This then can be the input for kickstart files, playbooks, or whatever, to make recreating the system after a fresh install easier.

Comment 1 Andrew Toskin 2015-11-09 01:37:02 UTC
@Matthew Miller

I was actually trying to figure out a way to do this when I followed you from the Stack Exchange thread to here, and I read your comment about how DNF actually tracks user-installed applications already. So I took a closer look at the dnf manpage, and I think I got it... Perhaps you were looking at the `list` subcommand? That's what I would have expected.

Try `dnf history userinstalled` instead. It lists some extra things that I think were actually installed by anaconda, such as gnome-shell, but it's pretty much just what we were looking for.

Perhaps `dnf list` could have an alias added for `dnf history userinstalled`?

For some reason, `dnf history` requires sudo access, which seems weird, since `dnf list installed` doesn't require such privileges.

Running `dnf history` when backing up data and config files, and then running `dnf install` on the "userinstalled" list doesn't seem too complicated. But for less technical users, some might appreciate it if generating and using this list of applications were integrated into GNOME Software, or some other gui app.

Comment 2 Jaroslav Mracek 2015-11-09 12:48:47 UTC
The new option "user-installed" will be better for dnf repoquery due to better capability to formating output and so on.

Comment 3 Fedora Admin XMLRPC Client 2016-07-08 09:25:01 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Andrew Toskin 2016-07-22 23:31:22 UTC
If this issue is still being considered, the feature already exists as `dnf history userinstalled`. The only problem is that the output also includes a few things, such as anaconda, which I did not actually install myself, except as part of the process of installing Fedora itself.

If we were to change the command line, I think it would make more sense as a --user option to `dnf list installed`, or as the original post suggested, `dnf list marked`. Something along those lines.

Comment 5 Jaroslav Rohel 2017-04-25 20:34:59 UTC
PR with new option https://github.com/rpm-software-management/dnf/pull/797

Comment 6 Fedora Update System 2017-05-11 08:59:00 UTC
dnf-2.4.1-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-e0fa49ff81

Comment 7 Fedora Update System 2017-05-13 01:10:41 UTC
dnf-2.4.1-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-e0fa49ff81

Comment 8 Fedora Update System 2017-05-14 20:19:35 UTC
dnf-2.4.1-1.fc26 has been pushed to the Fedora 26 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.