Find and remove “leaves”

I installed and removed a lot of packages. I think unused dependencies are removed by sudo dnf autoremove and
sudo dnf clean all
but in .config and other places, I still see a lot of files from removed applications. Is there a way to easily find and delete those? I think GTKOrphan did something like that?

Or is there a clear list of folders where to look?

There is a plugin that can show you the leaves python3-dnf-plugin-leaves. WIth that plugin you can run dnf leaves and get the list of leaf packages.

Also you have python3-dnf-plugin-show-leaves which will show new leaves when running a dnf transaction.

Note: that most of the leaves you would not want to remove, so this may not be what you wanted.

Thanks Villy.
What do you mean with your note? That it’s best not to remove those leaves?
I would think they take up space for nothing, but also: if I ever install the original package again, it will use those files with maybe outdated information or for instance expecting a password I don’t remember (or an account that doesn’t exist anymore).
Like the remnants of a virtual machine, with a configuration that doesn’t sooth me anymore or that makes the VM think I have certain iso’s that I don’t have and then gives me unexplainable errors.

Those are local user left-overs. I don’t know of anything that will automatically remove such config files from a users home directory. It seems up to the user to keep track of what is added to their home directory when installing and running apps so they can clean out the left-overs when that app is removed.

Comments above appear to be related to cleaning up system left-overs, but your question appears related to left-overs in the home directory area.

The title of this thread is misleading in that respect and should probably be updated.

You probably get more that 700 leaf packages where most of them are actually needed for some purpose.

But it looks like you are not actually asking about leaf packages.

Hey Jeff, I don’t know a lot about Linux in the sense that I’m no programmer. I keep learning and I’m not afraid to use the terminal, but I only use and understand a few basic commands. And sometimes I follow a step-by-step guide, copying and pasting and only understanding a little of what I’m doing. I’m mostly an end-user, you could say.
So while I’m configuring my Framework laptop with Fedora, sometimes I end up in different folders like /etc or /bin or /shared or /usr (for instance, because Catfish brought me there). when I’m there, I see a whole lot of leftover parts from programs I tried, but didn’t like, like music players, text editors, mail clients, … As I’m new, I’m testing a lot of programs to find out what works best for me.
It seems cleaner to remove all those files, for space and to have a clear overview and for the reason explained above. Somewhere I read that the word for those files is “leaves”. Is that not the right word for it? Then what’s a more accurate name for those files?

And I’m not talking only about left-overs in the home directory area, that was just one example. In fact, it is exactly because I don’t know in what places to look that I just gave that example. If I could sum up all places where to find such remnants, I would have the question I posed.

So, is the title still wrong you think? If so, I will change it.

I really don’t know what is the correct name. But if I don’t use Amarok or BlueMail for instance, I would expect that it wouldn’t be wrong to remove any file with that name, anywhere on my system?

Don’t do that!!!

Many individual commands may be used by many different apps and are not ‘leaves’ nor ‘left-overs’.

Each app when installed verifies and identifies the necessary dependency files and packages. When removing the app with the package manager the required changes are made.

If you manually remove what you think may not be needed it is almost certain to break something else on the system.

Just realize that the system knows what is needed and that if you manually make changes then breakage is almost 100% certain in every location except your home directory (and maybe even there in certain cases).

As long as your system is not crying because of inadequate space it is best to leave things alone.
The system knows best

The definition of a leaf in system vernacular is a package on which nothing else relies. Removing that package will not break any other app. Files do not fit that description and only if you use the package manager [dnf] (or are an expert in using package management tools) to remove them will you be certain that removing any individual file will not break some installed app/package.

1 Like

OK! Thank you!