Page 1 of 1

[MAQeia] Orphan packages explanation

PostPosted: Nov 13th, '12, 01:33
by saptech
If I install a package using "urpmi alien" and let's say it will install 10 files total, then if I remove the package using the "urpme" command, does it remove all 10 files total?

If not, what is the best command to use to remove all 10 files?

Thnx.

Re: Removing Packages

PostPosted: Nov 13th, '12, 19:35
by doktor5000
No, it will only remove the package that you requested to install, not the dependencies.
This is what the urpme --auto-orphans options was intended to do, and basically it works as designed, if you know how it really works,
as there's some mechanics that you need to know and need to pay attention to, so that it works exactly as you requested.

Small example:
You have a clean system as starting point, where urpme --auto-orphans gives no orphans, that is,
all packages currently installed were requested by you to be installed. Literally each one.
Then you install package foo, this pulls in packages bar and baz.

The orphans function marks bar and baz as not explicitely requested by putting them into /var/lib/rpm/installed-through-deps.list
Then, some time later you want to remove foo. But bar and baz stay, as they may still be of use, maybe they are some shared libraries.
Now, you could remove them via urpme --auto-orphans.

You can manually mark packages "un-orphaned" (i.e. remove them from /var/lib/rpm/installed-through-deps.list) by
telling urpmi to install that package, that will do nothing but remove it from the orphans list, as you told urpmi
directly to install it.

That is the ideal case. Just run urpme --auto-orphans (but DO NOT say yes to remove packages!!!)
to see how many "orphans" you currently have. If you want to keep them, just urpmi all of them ...
Then it works as you requested, and as i described.

Only other way would be to
Code: Select all
grep -F [RPM] /var/log/syslog
and look for packages that were installed
together with the one you want to remove to manually remove them also, but that's more fiddling ...

Re: Removing Packages

PostPosted: Nov 14th, '12, 18:26
by djennings
There is a good reason to be cautious with urpme --auto-orphans.

It is VERY easy to unintentionally remove important packages with it.


Consider this example.
You have the meta-package task-kde installed. A meta package is an empty package which does not contain any files, but has many other packages as dependencies. task-kde has 100's of packages as dependencies.

Now you remove just one of those packages because you do not want it. Say for example it is the document reader okular. Removing okular means that one of the dependencies of task-kde is missing and so the meta package task-kde is removed as well. That is fine, all the other packages which were installed as part of task-kde are still in place, only now they are marked as orphans. Now if you were to run urpme --auto-orphans you would see there were 100's of orphaned packages, and one press of your keyboard would erase your entire KDE installation.

Lots of newbies have caused serious damage to their installation because they paid attention to the pop up window rpmdrake shows after deleting a package about removing orphans. I for one wish that rpmdrake hid the existence of the --auto-orphan option.

Re: Removing Packages

PostPosted: Nov 15th, '12, 21:48
by saptech
I understand somewhat about the --auto-orphan issue. If I'm not mistaken, it was an issue with Mandriva also. I hardly run it myself. I was just wondering about removing small files with few dependencies as the example I gave. But since most of the smaller programs use few dependencies, I guess it's okay to leave them installed if I remove the main program. The size shouldn't matter now days with huge hard drive space.

Thanks for the replies.

Re: Removing Packages

PostPosted: Nov 15th, '12, 22:22
by doktor5000
Can you please mark the thread as [SOLVED] or [DONE]? BTW, i've forwarded this to the doc team, resulting in https://wiki.mageia.org/en/Removing_packages

Re: Removing Packages

PostPosted: Nov 16th, '12, 09:35
by saptech
Thanks for fowarding it to the Doc team...

Re: Removing Packages

PostPosted: Jan 17th, '13, 12:03
by filip
doktor5000 wrote:... i've forwarded this to the doc team, resulting in https://wiki.mageia.org/en/Removing_packages

Thanks doktor5000, I think it also deserve a place in MAQeia somewhere as it's very clear, informative and important.

What about reporting a bug as mentioned in the last sentence there:
I for one wish that rpmdrake hid the existence of the urpme --auto-orphans option.
I think that many of us agree with that :D.

Re: (DONE) Removing Packages

PostPosted: Jan 17th, '13, 23:25
by doktor5000
Well, making a MAQeia out of it only duplicates the information. Maybe we should first discuss what should be put where, forum or wiki ...

For the bug, there's https://bugs.mageia.org/show_bug.cgi?id=8123 now which is partly about this topic.
But i agree too with that behaviour, the message should be made opt-in, and not like it is currently, not even opt-out.

Re: (DONE) Removing Packages

PostPosted: Jan 17th, '13, 23:48
by filip
doktor5000 wrote:Well, making a MAQeia out of it only duplicates the information. Maybe we should first discuss what should be put where, forum or wiki ...
I had link in my mind. So no duplication. I think that wiki has priority over forum for documentation and forum is one of our communication tools and as such could be also a good pointer to wiki. Especially for newcomers. At least that is the way I see them.

Re: (DONE) Removing Packages

PostPosted: Jan 17th, '13, 23:59
by doktor5000
I've added viewtopic.php?f=36&t=4231 and will continue when i've got more time *zzzzzzzzzzzzz*

Re: (DONE) Removing Packages

PostPosted: Jan 18th, '13, 09:07
by filip
Thanks for your contributions doktor5000.

Visits will tell us some hints about its usefulness.

Re: [MAQeia] Orphan packages explanation

PostPosted: Nov 18th, '14, 21:27
by doktor5000
FWIW, simply converted this to a MAQeia as it was lurking and hidden in the abyss of old zombie forum threads.

Re: [MAQeia] Orphan packages explanation

PostPosted: Nov 19th, '14, 14:18
by doktor5000
filip wrote:What about reporting a bug as mentioned in the last sentence there:
I for one wish that rpmdrake hid the existence of the urpme --auto-orphans option.
I think that many of us agree with that :D.

That has long ago been reported and "resolved": https://bugs.mageia.org/show_bug.cgi?id=920
As the issue still persists and was not really fixed, I've cloned it into a new bug: https://bugs.mageia.org/show_bug.cgi?id=14594

For further bugs related to orphans, see https://wiki.mageia.org/en/Removing_pac ... ug_reports