Bug 464766

Summary: If an error message shown to the user contains the text " dpkg --configure -a", add a "Fix it" button that runs that command
Product: [Applications] Discover Reporter: Nate Graham <nate>
Component: PackageKitAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: wishlist CC: aleixpol, kevindu52defargoth
Priority: NOR    
Version First Reported In: master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Nate Graham 2023-01-24 20:37:59 UTC
On apt-using distros, we get a *lot* of bug reports from users about this condition. See:

https://bugs.kde.org/buglist.cgi?bug_status=RESOLVED&bug_status=NEEDSINFO&bug_status=VERIFIED&bug_status=CLOSED&classification=Applications&classification=I%20don%27t%20know&f0=OP&f1=OP&f2=product&f3=component&f4=alias&f5=short_desc&f7=content&f8=CP&f9=CP&j1=OR&list_id=2258386&o2=substring&o3=substring&o4=substring&o5=substring&o7=matches&product=Discover&product=kde&product=muon&query_format=advanced&resolution=FIXED&resolution=INVALID&resolution=WONTFIX&resolution=LATER&resolution=REMIND&resolution=DUPLICATE&resolution=WORKSFORME&resolution=MOVED&resolution=UPSTREAM&resolution=DOWNSTREAM&resolution=WAITINGFORINFO&resolution=BACKTRACE&resolution=UNMAINTAINED&v2=dpkg%20--configure%20-a&v3=dpkg%20--configure%20-a&v4=dpkg%20--configure%20-a&v5=dpkg%20--configure%20-a&v7=%22dpkg%20--configure%20-a%22

The bug is ultimately not Discover's fault:
- It's Apt or dpkg's fault for allowing this situation in the first place
- It's also the fault of the PackageKit plugin for passing this error on verbatim to PackageKit which is used by GUI tools, rather than reformatting it to be more comprehensible to users unfamiliar with the command line
- It's the fault of PackageKit for not having any API to offer interactivity or choices to the user

However this situation has persisted for years, and there's no reason to imagine that it will change anytime soon. If we want to save our users from this, it's probably up to us. I recommend adding code that checks for whether error messages contain the text "dpkg --configure -a". If an error message is a match, add a button that says "Fix it" that runs that command and reloads the view.

If we don't do this, I think we're going to continue getting un-actionable bug reports that waste our time and make Discover look broken for users on apt-using distros forever. :/