Bug 1359482 - Trying to remove 'KDE Plasma Workspaces' group using dnf tries to remove systemd and dnf
Summary: Trying to remove 'KDE Plasma Workspaces' group using dnf tries to remove syst...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 24
Hardware: x86_64
OS: Linux
high
unspecified
Target Milestone: ---
Assignee: Jaroslav Mracek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-24 06:45 UTC by notadrop
Modified: 2023-02-21 08:26 UTC (History)
14 users (show)

Fixed In Version: dnf-2.6.3-1.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 15:50:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description notadrop 2016-07-24 06:45:13 UTC
Description of problem: I performed a fresh install of Fedora 24 about two weeks ago. During that time, I decided to try the KDE Desktop, as an alternative to the default GNOME, so I ran "dnf groups install 'KDE Plasma Workspaces'" which worked as expected and installed the requested desktop environment and some other applications. Removing KDE, however, has proven to be a much more difficult task. When I run "dnf group remove 'KDE Plasma Workspaces'" I get the following message: "Error: The operation would result in removing the following protected packages: systemd, dnf."

I cannot understand why, when I am trying to remove a desktop environment, dnf tries to gut my system and remove the package manager and init system. Surely this is not intended behaviour?

Comment 1 Lucious 2016-07-24 14:47:28 UTC
(In reply to mozarella.firefox from comment #0)
> Description of problem: I performed a fresh install of Fedora 24 about two
> weeks ago. During that time, I decided to try the KDE Desktop, as an
> alternative to the default GNOME, so I ran "dnf groups install 'KDE Plasma
> Workspaces'" which worked as expected and installed the requested desktop
> environment and some other applications. Removing KDE, however, has proven
> to be a much more difficult task. When I run "dnf group remove 'KDE Plasma
> Workspaces'" I get the following message: "Error: The operation would result
> in removing the following protected packages: systemd, dnf."
> 
> I cannot understand why, when I am trying to remove a desktop environment,
> dnf tries to gut my system and remove the package manager and init system.
> Surely this is not intended behaviour?

Hello, I believe I saw you on IRC last night asking about this issue. I used a Fedora 24 VM to test this and got your same result. However, I was able to get a clean removal using a method from Fedora's Documenatation.

https://docs.fedoraproject.org/en-US/Fedora/16/html/System_Administrators_Guide/sec-Removing.html

~]# dnf remove @kde-desktop

Double-check the packages to be removed, because I tested from a basic install and I don't know what else you have installed. But I agree, you would think KDE could be removed safely using the 'dnf group remove.'

Comment 2 notadrop 2016-07-24 22:58:33 UTC
Thank you, the command

~]# dnf remove @kde-desktop

worked. 

However, I'm frustrated that this isn't in the man pages, at least not that I could find, and that 'dnf group remove' does *not* do what the user expects at all!

Comment 3 Honza Silhan 2016-08-01 11:33:13 UTC
Can you please attach debugdata [1]?

[1] https://github.com/rpm-software-management/dnf/wiki/Bug-Reporting#dependency-resolution-problem

Comment 4 Igor Gnatenko 2016-08-05 06:25:24 UTC
(In reply to Jan Silhan from comment #3)
> Can you please attach debugdata [1]?
you can easily reproduce it. if you have workstation, just try to remove "fedora workstation" group and you will get same results.

Comment 5 notadrop 2016-08-15 19:26:33 UTC
Seconding comment four, what Igor Gnatenko said.

Comment 6 Gilbert Martin 2016-08-20 04:50:06 UTC
(In reply to notadrop from comment #2)
> Thank you, the command
> 
> ~]# dnf remove @kde-desktop
> 
> worked. 
> 
> However, I'm frustrated that this isn't in the man pages, at least not that
> I could find, and that 'dnf group remove' does *not* do what the user
> expects at all!

Ok, had the same problem with the Cinnamon Spin, and try KDE...

The fix work, but why do I still have this when I run "dnf grouplist" :

Installed environment groups:
   KDE Plasma Workspaces

and when I run again "dnf grouperemove "KDE Plasma Workspaces""

I still get: 

Last metadata expiration check: 0:29:24 ago on Fri Aug 19 23:19:02 2016.
Dependencies resolved.
Error: The operation would result in removing the following protected packages: systemd, dnf.


Note: I have install konsole, so it might be the reason.

Comment 7 Jaroslav Mracek 2016-09-08 10:47:16 UTC
I investigate the issue and find very interesting points. Just from beginning, the environmental groups are composed from groups. See list of mandatory groups. 

 Mandatory Groups:
   Administration Tools
   Common NetworkManager Submodules
   Core
   Dial-up Networking Support
   Fonts
   Guest Desktop Agents
   Hardware Support
   Input Methods
   KDE
   Multimedia
   Printing Support
   Standard
   base-x

If you compare env_groups, you will see that all of them has one common group `core`. If you install additional env-group, it install or mark required groups as installed. So far it is fine. The primary problem is that during system deploy installator (anaconda) didn't mark installed groups, but marked only packages that where installed with reason group (the problem is already fixed). To prevent the problem you have to, before you want to uninstall env-group, fix the problem by marking group "Fedora Workstation" as installed (``dnf group install "Fedora Workstation"`` or ``dnf group mark install "Fedora Workstation"``). Then your system will not try to remove group "core" because it is required by other env_group. 

From my side I think I can close the bug, because it will be solved in next fedora where groups will be marked correctly. Please if my description doesn't help, or you will discover other issue, please don't hesitate to reopen it or file new beg report. Feed backs from users are really important to us.

Comment 8 David Demelier 2017-07-25 10:51:32 UTC
I'm affected by this bug as well.

Comment 9 Jaroslav Mracek 2017-07-25 11:24:41 UTC
Please David if you are not satisfied with solution in Comment 7, provide additional information. Anyway we cannot refactor dnf-1.1 into dnf-2.5+, therefore issues with group implementation from up to fedora 25 cannot be solved.

Comment 10 David Demelier 2017-07-26 07:33:03 UTC
I have tried installing 'Fedora Workstation' before doing dnf group remove 'KDE Plasma Workspaces' but I get this error:

$ sudo dnf group remove 'KDE Plasma Workspaces'
Dependencies resolved.
Traceback (most recent call last):
  File "/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 123, in cli_run
    ret = resolving(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 154, in resolving
    base.do_transaction(display=displays)
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 170, in do_transaction
    grp_str = self.output.list_group_transaction(self.comps, self._group_persistor, grp_diff)
  File "/usr/lib/python3.6/site-packages/dnf/cli/output.py", line 948, in list_group_transaction
    grp_name = comps._group_by_id(grp_id).ui_name
AttributeError: 'NoneType' object has no attribute 'ui_name'

Comment 11 Jaroslav Mracek 2017-07-26 08:44:22 UTC
Please could you provide a version of dnf, output of "dnf group list" and "dnf repolist"?

Thanks

Comment 12 Jaroslav Mracek 2017-08-01 17:55:21 UTC
I provide a patch, but this is a blind fix (https://github.com/rpm-software-management/dnf/pull/881).

Comment 13 Ricky 2017-08-04 19:29:00 UTC
I experienced the same problem when uninstall plasma:

sudo dnf groupremove "KDE Plasma Workspaces"

Dependencies resolved.
Traceback (most recent call last):
  File "/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 123, in cli_run
    ret = resolving(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 154, in resolving
    base.do_transaction(display=displays)
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 170, in do_transaction
    grp_str = self.output.list_group_transaction(self.comps, self._group_persistor, grp_diff)
  File "/usr/lib/python3.6/site-packages/dnf/cli/output.py", line 954, in list_group_transaction
    grp_name = comps._group_by_id(grp_id).ui_name
AttributeError: 'NoneType' object has no attribute 'ui_name'

Running command sudo dnf remove @kde-desktop didn't remove Plasma. As I still see plasma packages.

Why there is KDE desktop and Plasma workspace? Are they supposed to be same?

Comment 14 Fedora Update System 2017-08-07 12:50:17 UTC
dnf-2.6.3-1.fc26 dnf-plugins-extras-2.0.2-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4813633f96

Comment 15 Fedora Update System 2017-08-08 01:24:19 UTC
dnf-2.6.3-1.fc26, dnf-plugins-extras-2.0.2-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-4813633f96

Comment 16 Fedora End Of Life 2017-08-08 15:50:20 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 17 Fedora Update System 2017-08-09 15:59:42 UTC
dnf-2.6.3-1.fc26, dnf-plugins-extras-2.0.2-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Parminder Lehal 2021-03-15 16:38:43 UTC
Fedora 33 exhibit the same behavior.i.e. "KDE Plasma Workspaces" cannot be removed using dnf as it tries to remove sudo also.

Comment 19 David Demelier 2023-02-21 07:57:27 UTC
It seems closed but I get a new mail each day about this bug, why?

Comment 20 Marek Blaha 2023-02-21 08:26:46 UTC
Probably because of the needinfo flag. Now that you've removed it, the emails should stop.


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