Bug 1414512

Summary: [rfe] Add dnf api for autoremove
Product: [Fedora] Fedora Reporter: Alberto Murillo <powerbsd>
Component: dnfAssignee: Martin Hatina <mhatina>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: rawhideCC: jmracek, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: EasyFix, FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-10 15:50:16 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:

Description Alberto Murillo 2017-01-18 17:16:45 UTC
Description of problem:
dnf api lacks an option for `dnf autoremove`

Version-Release number of selected component (if applicable):
1.1.10

Im working on adding `dnf autoremove` for the dnf module in ansbile. The related issue is here: https://github.com/ansible/ansible/issues/18815

Currently the only way to autoremove unneeded packages is by explicitly removing one installed package and dnf would autoremove all other unneeded packages by default but there is no way to just remove the unneeded packages without marking an installed package for removal too.

A base.autoremove() api can get be used for this task.

A base.sack.query().unneeded() api could make it possible to get a list of the packages that are candidate to be removed and have more control over the packages
to remove than base.autoremove()

Comment 1 Martin Hatina 2017-01-30 13:55:58 UTC
Fixed by https://github.com/rpm-software-management/dnf/pull/716

Comment 2 Jaroslav Mracek 2017-02-10 15:50:16 UTC
Bugs fixed in version 2.0.1-1.