Bug 2066638 - "dnf group remove" removes packages that belong to another installed group
Summary: "dnf group remove" removes packages that belong to another installed group
Keywords:
Status: CLOSED COMPLETED
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 37
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Kolarik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-22 08:55 UTC by Marek Blaha
Modified: 2023-11-20 15:03 UTC (History)
9 users (show)

Fixed In Version: dnf-4.18.0-2.fc37
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-20 15:03:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
testing repository (4.07 KB, application/gzip)
2022-03-22 08:55 UTC, Marek Blaha
no flags Details

Description Marek Blaha 2022-03-22 08:55:00 UTC
Created attachment 1867404 [details]
testing repository

Description of problem:
According to dnf(8) should only "remove those packages in the group  from  the system  which  do not belong to another installed group and were not installed explicitly by the user."
But currently dnf removes also packages that are part of another installed group.

How reproducible:
Always.


Steps to Reproduce:
1. create testing repo with two groups sharing packages. You can use the one from the attachment with following layout:
@first-group: with packages GrpTestA, GrpTestB
@second-group: with package GrpTestA

2. dnf group install first-group
Installing group/module packages:
 GrpTestA           x86_64           1.0.1-0           group-remove-test           5.9 k
 GrpTestB           x86_64           1.0.1-0           group-remove-test           5.9 k
Installing Groups:
 First test group

3. dnf group install second-group
Installing Groups:
 Second test group

4. dnf group remove first-group

Actual results:

Package GrpTestA is removed even though it is also part of installed second-group

Removing:
 GrpTestA          x86_64          1.0.1-0             @group-remove-test            0  
 GrpTestB          x86_64          1.0.1-0             @group-remove-test            0  
Removing Groups:
 First test group


Expected results:
Package GrpTestA stays on the system:

Removing:
 GrpTestB          x86_64          1.0.1-0             @group-remove-test            0  
Removing Groups:
 First test group


Additional info:
If both groups are installed in the same transaction everything works correctly:
# dnf group install first-group second-group
# dnf group remove first-group
Removing:
 GrpTestB          x86_64          1.0.1-0             @group-remove-test            0  
Removing Groups:
 First test group

Comment 1 Ben Cotton 2022-08-09 13:14:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 2 Jan Kolarik 2023-09-21 11:01:22 UTC
Following PR was queued to fix this issue: https://github.com/rpm-software-management/dnf/pull/1995.


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