Page 1 of 1

[SOLVED] Removing packages with dependencies

PostPosted: Dec 5th, '12, 00:28
by roti
Hi,

Consider following scenario:
- I have a mageia system with E17 and some KDE apps (like Krusader), which means that some of KDE dependencies are already installed
- from there I install task-kde4-minimal, which leads to installing about 400 new packages
- some time later I decide to remove task-kde-minimal with all it's dependencies (namely the 400 new packages), but get into following:

Code: Select all
[root@mypc ~]# urpme task-kde4-minimal
removing task-kde4-minimal-4.8.5-1.3.mga2.noarch
removing package task-kde4-minimal-4.8.5-1.3.mga2.noarch
writing /var/lib/rpm/installed-though-deps.list

The following packages:
  kde4-nsplugins-4.8.5-1.1.mga2.x86_64
  plasma-applet-folderview-4.8.5-1.1.mga2.x86_64
  plasma-applet-showdesktop-4.8.5-1.1.mga2.x86_64
are now orphaned, if you wish to remove them, you can use "urpme --auto-orphans"


I have two questions:
1) why can I see only three orphan packages?
2) what I the recommended way to remove software? (meaning the package with all its dependencies, that are not not required by other packages)

I have experience only with with apt-get and pacman. They both have mechanisms to handle automatically installed packages (meaning packages that were installed as dependencies). For example, apt-get marks a package as automatically installed or manually installed. An automatically installed package, that is not required by any other manually installed packages is considered "orphan" and can be removed.

My expectation here, is that removing "task-kde4-minimal" will also remove all it's dependencies, except those that are still required (in my case some are still required by krusader). Of course, the removal of dependencies must not necesarily happen in the same step.

Since I am new to urpmi, please help me find out if and how I can achieve this. Thanks
roti

Re: Removing packages with dependencies

PostPosted: Dec 5th, '12, 13:44
by claire
Hi roti

What do you get with..

Code: Select all
$ rpm -qa | grep task-kde4

Re: Removing packages with dependencies

PostPosted: Dec 5th, '12, 20:46
by roti
claire wrote:Hi roti

What do you get with..

Code: Select all
$ rpm -qa | grep task-kde4


Nothing.
Code: Select all
[root@pella ~]# rpm -qa | grep task-kde4
[root@pella ~]#


roti

Re: Removing packages with dependencies

PostPosted: Dec 6th, '12, 00:31
by djennings
1) why can I see only three orphan packages?

If when you remove task-kde-minimal you see only 3 orphan packages, then it must be that you have manually installed another package that has all the kde libraries as dependencies.
The obvious package which would do that is task-kde which is why Claire asked. Another package which would retain a large chunk of KDE is kdebase4 and there are several others.

A circumstance which could lead to a package being marked as manually installed is for example when you issue a urpmi command on a package that is already installed like in this example

Code: Select all
# urpmi xfprint
Package xfprint-4.6.1-5.1.mga2.x86_64 is already installed
Marking xfprint as manually installed, it won't be auto-orphaned
writing /var/lib/rpm/installed-through-deps.list


2) what I the recommended way to remove software? (meaning the package with all its dependencies, that are not not required by other packages)

Good question urpme --auto-orphans as you know will remove **all** orphan packages, and it is so easy for a package to become an orphan that I personally *never* use that command. I would rather leave unused packages lying around than risk uninstalling something important by accident.

Re: Removing packages with dependencies

PostPosted: Dec 6th, '12, 02:17
by Ken-Bergen
roti wrote:I have two questions:
1) why can I see only three orphan packages?
2) what I the recommended way to remove software? (meaning the package with all its dependencies, that are not not required by other packages)
The answer to the first question is easy.
The orphans were already orphaned.

The second not so easy.
You could try
Code: Select all
urpmq --requires-recursive task-kde4-minimal | grep kde
There will only be about ten packages starting with kde.
Removing those packages then running
Code: Select all
urpme --auto-orphans
Should give the results you're looking for.

As always look over the list of orphans carefully least you break something else.

Re: Removing packages with dependencies

PostPosted: Dec 6th, '12, 23:04
by roti
djennings wrote:
2) what I the recommended way to remove software? (meaning the package with all its dependencies, that are not not required by other packages)

Good question urpme --auto-orphans as you know will remove **all** orphan packages, and it is so easy for a package to become an orphan that I personally *never* use that command. I would rather leave unused packages lying around than risk uninstalling something important by accident.

I have seen some discussions about auto-orphans on this forum, and as far as I understood, it can happen for a package to become orphan even if it is required as a dependency by another installed package (other than the one currenly beeing removed). Is this correct? If yes, then I can understand why auto-orphans is not recommended. If not, then I'm puzzled.

Re: Removing packages with dependencies

PostPosted: Dec 6th, '12, 23:40
by Ken-Bergen
doktor5000 wrote:Last edited by doktor5000 on Dec 6th, '12, 11:40, edited 1 time in total.
Reason: fixed last command, was missing a few letters ;)
Actually the command both as I posted it and as you edited it do the same thing. :P
I also use
Code: Select all
urpmi --auto-u
for updates.
It saves wear and tear on the fingers and keyboard.