Bug 2216622 - Regression: Unknown argument "--noautoremove" for command "remove".
Summary: Regression: Unknown argument "--noautoremove" for command "remove".
Keywords:
Status: POST
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf5
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jan Kolarik
QA Contact:
URL: https://artifacts.dev.testing-farm.io...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-22 05:47 UTC by Martin Pitt
Modified: 2023-08-16 08:11 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Martin Pitt 2023-06-22 05:47:06 UTC
The latest update of Rawhide moved to dnf5. This forgot about "dnf remove -y --noautoremove ...".

This option is hard to avoid -- without --noautoremove it will remove automatic dependencies (which breaks our test), and with `rpm -e` it will fail because some other (unpredictable for us) packages depend on it.

Reproducible: Always

Steps to Reproduce:
dnf remove --noautoremove bash-doc
Actual Results:  
Unknown argument "--noautoremove" for command "remove". Add "--help" for more information about the arguments.

Expected Results:  
dnf removes the specified packages and packages that depend on it, but not automatic dependencies of the specified packages -- as before.

Comment 1 Jan Kolarik 2023-06-22 06:10:46 UTC
Hi, I guess this is due to "clean_requirements_on_remove" configuration option set to True by default. You can switch it off to achieve the desired behavior, either in configuration file /etc/dnf/dnf.conf like "clean_requirements_on_remove=False" or with command-line switch: "dnf5 remove bash-doc --setopt=clean_requirements_on_remove=False".

Comment 2 Jan Kolarik 2023-06-22 06:25:12 UTC
I've tried to improve our documentation with creating this PR: https://github.com/rpm-software-management/dnf5/pull/641.

Comment 3 Martin Pitt 2023-06-22 06:40:57 UTC
Thanks for the hint about "--setopt=clean_requirements_on_remove=False". That seems to work on at least Fedora 38 as well. I'll test it in https://github.com/cockpit-project/cockpit/pull/18987 if it also works on C8S and others.

Comment 4 Martin Pitt 2023-06-22 06:48:37 UTC
❱❱❱ podman run -it --rm quay.io/centos/centos:stream8 sh -exc 'dnf install -y bash-doc; dnf remove --setopt=clean_requirements_on_remove=False bash-doc'

This actually works, nice! So we have a command that continues to work everywhere. That plus the doc update seems fine to me, thanks!

Comment 5 Fedora Release Engineering 2023-08-16 08:11:15 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.


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