Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update desktop-environment.md #1190

Merged
merged 2 commits into from
Dec 15, 2023
Merged

Update desktop-environment.md #1190

merged 2 commits into from
Dec 15, 2023

Conversation

memachado
Copy link
Contributor

This addition offers users a more comprehensive solution for removing KDE and its associated packages. This enhancement aims to provide clearer and more user-friendly instructions for managing desktop environments on Pop!_OS.

@jacobgkau jacobgkau requested a review from a team October 19, 2023 17:44
Copy link
Member

@jacobgkau jacobgkau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The article shows how to install KDE by running sudo apt install kde-standard, which will install kde-standard's dependencies. Running an autoremove --purge kde-standard will remove kde-standard and everything installed as a dependency of it. There's no reason why kde-* would be needed unless the user installed KDE via a different package/method.

The kde-* wildcard may uninstall more packages than intended; for example, if I installed the kde-spectacle program to use in GNOME, then I later installed kde-standard, running sudo apt purge kde-* will remove kde-spectacle even though it wasn't installed as part of the desktop environment.

Also, purge is actually less comprehensive than an autoremove --purge because purge will not remove dependencies by itself; it would require another autoremove --purge after it. (In this case, there is one immediately after it, but specifying kde-standard in that one after kde-* was already purged is redundant.) It's probably best to use autoremove --purge in all instances here.

I think there's a place for the wildcard/pattern-matching concept in this article, but it should be separated into a separate section for if the reader's forgotten which package(s) they manually installed.

Additionally, * wildcards aren't reliable; if you touch kde-testing and then try to run the sudo apt purge kde-* command in the same directory, you'll get an error that no kde-testing package is found, because that wildcard is matched to the filename rather than package names. Instead, sudo apt purge '?name(^kde-)' would do the same thing (remove packages starting with kde-), without running into issues in case of matching filenames.

@memachado
Copy link
Contributor Author

@jacobgkau Thank you for the feedback and explanation. I did not consider those points prior to the PR. I'll run some more tests, if nothing goods come out, I drop the PR. Bye.

@memachado
Copy link
Contributor Author

memachado commented Oct 19, 2023

@jacobgkau

To test the current example and documentation:

  • Fresh installation
  • Installed the KDE Standard as described in the docs
  • Rebooted, logged in, and tested KDE
  • Rebooted again, logged into GNOME
  • "Removed" as described in the docs
  • Rebooted and was able to log in again to the KDE environment because KDE was not uninstalled, hence my attempt to further enhance the docs.

The method in this PR was found on Stack Overflow, but I traced it to the old version of these docs.

Although the old/proposed method can remove unintended packages, the current method does not remove the necessary packages.

@jacobgkau
Copy link
Member

Thank you for the steps and elaborating on the issue. I can recreate that with kde-standard. I'm not quite sure what's going on yet, but I'll try to look into it a little further.

(Playing around with -o APT::Autoremove::SuggestsImportant=0 and -o APT::Autoremove::RecommendsImportant=0, it looks like it might be other, preinstalled packages that suggest or recommend some of the KDE packages or their dependencies/recommendations. The former option removes too little and the latter option removes too much, though. plasma-workspace and plasma-desktop may be creating the issue between themselves, from what I'm seeing trying to use aptitude why on them.)

If we do stick with the wildcard option, we'll still want to use regex rather than the asterisk.

@memachado
Copy link
Contributor Author

If we do stick with the wildcard option, we'll still want to use regex rather than the asterisk.

Still, the regex would need to be sudo apt purge '?name(-kde-)' because packages like qml-module-org-kde-*. And even after that some packages will remain.

Maybe change the example to another desktop environment, and include a warning about kde remaining packages after install? This way people can choose how to proceed.

@jacobgkau
Copy link
Member

Maybe change the example to another desktop environment, and include a warning about kde remaining packages after install?

I don't see how removing the KDE example will help if that's one that we know currently has problems.

Still, the regex would need to be sudo apt purge '?name(-kde-)' because packages like qml-module-org-kde-*. And even after that some packages will remain.

Actually, using the ^kde- regex with autoremove, I do see qml-module-org-kde-... get removed even though it wouldn't be matched by that regex:

image

With autoremove, we don't actually need to match every package we want to be uninstalled, we just need to match the ones that apt doesn't want to uninstall unless we tell it to.

@jacobgkau
Copy link
Member

jacobgkau commented Oct 20, 2023

I've tried to explain the example in a simple but effective way. I do think this is a valuable addition, so thanks for bringing it up. (Let me know if you see any issues with what I changed it to.)

@jacobgkau jacobgkau requested a review from a team October 20, 2023 23:20
@memachado
Copy link
Contributor Author

With autoremove, we don't actually need to match every package we want to be uninstalled, we just need to match the ones that apt doesn't want to uninstall unless we tell it to.

My bad. I used sudo apt purge '?name(^kde-)' instead of sudo apt autoremove --purce '?name(^kde-)' .

I've tried to explain the example in a simple but effective way. I do think this is a valuable addition, so thanks for bringing it up. (Let me know if you see any issues with what I changed it to.)

Looks good to me.

Thank you.

memachado and others added 2 commits December 15, 2023 08:38
This addition offers users a more comprehensive solution for removing KDE and its associated packages. This enhancement aims to provide clearer and more user-friendly instructions for managing desktop environments on Pop!_OS.
@ahoneybun
Copy link
Member

@memachado is this ready to go with your latest changes?

@memachado
Copy link
Contributor Author

@ahoneybun Yes.

@ahoneybun ahoneybun merged commit 3320067 into system76:master Dec 15, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants