Remove debug libraries (semi)-automatically after bug rerport

To successfully report bug ABRT suggested me to install some debug packages. But sometimes the size is quite huge and over the time (few bugs) it can bloat the disk, esp when you only have smaller SSD disk. It’d be nice to have a tool (yum plugin?) that keep track of those packages so you can easily remove them. I searched sudo yum remove *debug* but it only “filtered” kernel-debug-devel and there are way more debug (abrt induced) libs installed.
Another thing, packages app (GUI) has no option of sorting (e.g by installed, I was searching for debug keyword), It could also display cummulative size of the packages selected.

Thanks Rob

I can’t help much with the GUI because I don’t use it (I’m an unrepentant old command-line guy!) but here’s a way you can see all of your installed packages sorted by size. At the command line

rpm -qa --qf '%-30{NAME}%{SIZE:humaniec}\n' |sort --key 2h

This uses rpm and asks for a query of all packages formatted to show the name and size in human terms (i.e. 1024 would be shown as 1K). That then gets passed to sort which is told to sort on the second column by human-readable sizes.

The result is a text list of all of your packages with the largest ones at the end. If you want, say, just the top ten, just use tail like so:

rpm -qa --qf '%-30{NAME}%{SIZE:humaniec}\n' |sort --key 2h |tail -n10

If you only want to see the top ten which have “debug” in the package name, use this:

rpm -qa --qf '%-30{NAME}%{SIZE:humaniec}\n' |grep debug |sort --key 2h |tail -n10

When I did that just now, kernel-debug-devel showed up three times, so I modified the command a bit to also show the version:

rpm -qa --qf '%-30{NAME}%-10{VERSION}%{SIZE:humaniec}\n' |grep debug |sort --key 3h |tail -n10

I hope that helps, and maybe inspires you to explore the many fabulous tools available on the command line.


Thanks, I’m qutie fine with cmd line (but that feature is quite primitive and also packages give description for given lib), but that 1st part of my question is what bothers me - keeping track of libs and packages installed cause of problem reporting

You may already know this, but dnf keeps track of your installations, so if you want to look at your history to figure out what you’ve installed recently, you can just use the command:

dnf history

I’ve used that before for similar reasons. If you haven’t added anything since then you might also find dnf rollback useful after you figure out where in your history you’d like to return to.

1 Like