You are not logged in.

#1 2011-04-07 17:00:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Removing conflicting packages

[karol@black ~]$ sudo pacman -S mplayer2
resolving dependencies...
looking for inter-conflicts...
:: mplayer2 and mplayer are in conflict. Remove mplayer? [y/N]

pacman removes just mplayer and leaves all the 'dangling' dependencies - packages that were needed by mplayer, but are not needed by mplayer2. Can this behavior be changed to 'pacman -Rns foo'? Is there such an option in pacman or are users expected to deal with this manually?

Offline

#2 2011-04-07 17:28:20

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Removing conflicting packages

Good one, i think this would be best reported on flyspray or the mailinglist.


ᶘ ᵒᴥᵒᶅ

Offline

#3 2011-04-07 18:25:11

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: Removing conflicting packages

That is why `pacman -Qdt` exist.

pacman -Rsn `pacman -Qqdt`

Last edited by JokerBoy (2011-04-07 18:26:11)

Offline

#4 2011-04-07 19:29:52

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: Removing conflicting packages

pacman -Qdt is not the greatest solution as long as we can't link optional dependencies to their "parent" package... That is, if you install optional dependencies with --asdeps.

Offline

#5 2011-04-07 23:20:37

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Removing conflicting packages

karol wrote:
[karol@black ~]$ sudo pacman -S mplayer2
resolving dependencies...
looking for inter-conflicts...
:: mplayer2 and mplayer are in conflict. Remove mplayer? [y/N]

pacman removes just mplayer and leaves all the 'dangling' dependencies - packages that were needed by mplayer, but are not needed by mplayer2. Can this behavior be changed to 'pacman -Rns foo'? Is there such an option in pacman or are users expected to deal with this manually?

I'm thinking it's for the best that you're expected to deal with this manually. If you want the behavior of pacman -Rsn mplayer, then do that instead of letting pacman remove just mplayer on the conflict.

Offline

#6 2011-04-08 10:44:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Removing conflicting packages

falconindy wrote:
karol wrote:
[karol@black ~]$ sudo pacman -S mplayer2
resolving dependencies...
looking for inter-conflicts...
:: mplayer2 and mplayer are in conflict. Remove mplayer? [y/N]

pacman removes just mplayer and leaves all the 'dangling' dependencies - packages that were needed by mplayer, but are not needed by mplayer2. Can this behavior be changed to 'pacman -Rns foo'? Is there such an option in pacman or are users expected to deal with this manually?

I'm thinking it's for the best that you're expected to deal with this manually. If you want the behavior of pacman -Rsn mplayer, then do that instead of letting pacman remove just mplayer on the conflict.

The question is why would you want to keep dangling dependencies? What's the benefit of keeping things as they are now?

Offline

#7 2011-04-08 10:48:52

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: Removing conflicting packages

karol wrote:
falconindy wrote:
karol wrote:
[karol@black ~]$ sudo pacman -S mplayer2
resolving dependencies...
looking for inter-conflicts...
:: mplayer2 and mplayer are in conflict. Remove mplayer? [y/N]

pacman removes just mplayer and leaves all the 'dangling' dependencies - packages that were needed by mplayer, but are not needed by mplayer2. Can this behavior be changed to 'pacman -Rns foo'? Is there such an option in pacman or are users expected to deal with this manually?

I'm thinking it's for the best that you're expected to deal with this manually. If you want the behavior of pacman -Rsn mplayer, then do that instead of letting pacman remove just mplayer on the conflict.

The question is why would you want to keep dangling dependencies? What's the benefit of keeping things as they are now?

*Not* removing something that the user has not specified he wants removed.

Each command to pacman 'means' something. This is for the same reason that pacman -R foo doesn't remove foo's dependencies, because -R just means "please remove this package". -Rns means "please remove this package and its unused dependencies.

In the case of pacman -S bar, where bar replaces foo (but changes dependencies), there's ambiguity as to whether the user intends pacman -R or pacman -Rns, so pacman errs on the safe side.

Or, seen differently, if you want the dependency removed you're gonna have to specify that. -S does not. Perhaps you COULD request additional options to -S which would do what you want (doubt it'd have much uptake though).


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#8 2011-04-08 11:11:00

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Removing conflicting packages

ngoonee wrote:

*Not* removing something that the user has not specified he wants removed.

Each command to pacman 'means' something. This is for the same reason that pacman -R foo doesn't remove foo's dependencies, because -R just means "please remove this package". -Rns means "please remove this package and its unused dependencies.

In the case of pacman -S bar, where bar replaces foo (but changes dependencies), there's ambiguity as to whether the user intends pacman -R or pacman -Rns, so pacman errs on the safe side.

Or, seen differently, if you want the dependency removed you're gonna have to specify that. -S does not. Perhaps you COULD request additional options to -S which would do what you want (doubt it'd have much uptake though).

Agreed, but it might not be a bad idea to at least notify the user that any leftover dependencies won't be removed. It is sort of counterintuitive that during an upgrade action that is designed to replace packages, you need to actively cancel the running action, remove a to-be-replaced package with a different command and then re-run the update, unless you want to be stuck with a possibly large number of unneeded other packages. So in this case some extra feedback to the user could be helpful.


ᶘ ᵒᴥᵒᶅ

Offline

#9 2011-04-30 22:54:21

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Removing conflicting packages

I finally managed to file a feature request https://bugs.archlinux.org/task/24005

Offline

#10 2011-05-02 14:31:28

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Removing conflicting packages

Thank you. I agree that it makes sense to atleast warn the user for starters.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#11 2011-05-02 17:06:31

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Removing conflicting packages

Inxsible wrote:

Thank you. I agree that it makes sense to atleast warn the user for starters.

What's the point, if it is already known? Besides, who said that I do not need some of the mplayer deps?


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#12 2011-05-02 17:19:27

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Removing conflicting packages

Leonid.I wrote:

What's the point, if it is already known? Besides, who said that I do not need some of the mplayer deps?

Huh?

I want to remove mplayer and all the unneeded deps and install mplayer2 and its deps. I would like to do it in one go.

Offline

#13 2011-05-02 18:51:50

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Removing conflicting packages

Right, by what if you are actually using those 'unneeded deps' for purposes other than mplayer/mplayer2? Just because a package is marked "asdep" does not imply that it has no stand-alone role...


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#14 2011-05-02 19:08:57

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Removing conflicting packages

Leonid.I wrote:

Right, by what if you are actually using those 'unneeded deps' for purposes other than mplayer/mplayer2? Just because a package is marked "asdep" does not imply that it has no stand-alone role...

I understand it's possible and I don't want to make 'pacman -Rns' the default behavior. This way you can chose the style that suits you (if it gets implemented ;P).
You can change the install reason of the standalone packages.

Offline

#15 2011-05-02 19:12:09

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Removing conflicting packages

'unneeded deps' would mean that they are no longer needed by any app on your machine.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#16 2011-05-02 19:18:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Removing conflicting packages

Inxsible wrote:

'unneeded deps' would mean that they are no longer needed by any app on your machine.

At least in theory you can have package A that is a dependency for package B and you decide to remove package B but keep package A. Even if it was installed as a dependency for package B, you can change the install reason to 'explicitly installed'.

There shouldn't be any packages with 'Install Reason : Installed as a dependency for another package' and 'Required By    : None'.

Offline

#17 2011-05-02 20:27:05

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Removing conflicting packages

Well, in theory. But in practice, that's going to be a mess. Example: libunique on one machine was installed asdep and correctly picked up by pacman -Qdt, while on the other it is listed as explicit. Why? who knows...

I think that the install reason should be there only for informational purposes, not as an indicator to take actions. Otherwise, to avoid wrong packages to be removed, I'll have to go through the list of packages everyday with pacman -D, as the output of pacman -Qdt changes pretty often. This kind of bookkeeping will work on a RHEL-type system, but not on a rolling release OS, especially as actively updated as Arch.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#18 2011-05-02 20:38:20

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Removing conflicting packages

Leonid.I wrote:

Well, in theory. But in practice, that's going to be a mess. Example: libunique on one machine was installed asdep and correctly picked up by pacman -Qdt, while on the other it is listed as explicit. Why? who knows...

There were some issues with clyde, maybe this will shed some light on the matter: https://bbs.archlinux.org/viewtopic.php … 61#p912361

Offline

#19 2011-05-02 21:20:11

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Removing conflicting packages

OK, let me rephrase my previous post, and compare complexities of the two situations:
(1) Current situation -- "pacman -S <-- y" replaces only the current pkg.
      I have to check pacman -Qdt to remove possible leftover deps.
(2) New situation -- "pacman -S --autoclean-deps" removes the current pkg + all its unneeded deps.
      I have to check pacman -Qi <current pkg> before the operation, in order to verify that nothing useful gets removed.

Personally, I think that (1) is less breakage-prone...


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#20 2011-05-02 21:55:23

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Removing conflicting packages

Leonid.I wrote:

Personally, I think that (1) is less breakage-prone...

I agree, but nobody will take it away from you. I wanted to suggest an option to remove the unneeded dependencies more aggressively.

Seems that there is an old bug that deals with the same / similar issue https://bugs.archlinux.org/task/5974

Offline

#21 2011-05-02 22:20:13

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Removing conflicting packages

karol wrote:
Leonid.I wrote:

Personally, I think that (1) is less breakage-prone...

I wanted to suggest an option to remove the unneeded dependencies more aggressively.

I'm ok with that, as long as it's not the default...

karol wrote:

Seems that there is an old bug that deals with the same / similar issue https://bugs.archlinux.org/task/5974

Good point. This and your feature request do indeed ask for the same option switch. In the older report, however, the concensus seems to be in favor of the manual orphan management hmm

EDIT: Off-topic. Does anyone know how fluxbb manages timestamps? Because right now they seem to be in a random timezone... and very inconvenient for discussions like the present one.

Last edited by Leonid.I (2011-05-02 22:22:57)


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#22 2011-05-02 22:26:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Removing conflicting packages

Leonid.I wrote:

Good point. This and your feature request do indeed ask for the same option switch. In the older report, however, the concensus seems to be in favor of the manual orphan management hmm

So maybe we can close two bugs as a 'won't fix' :-)

Leonid.I wrote:

EDIT: Off-topic. Does anyone know how fluxbb manages timestamps? Because right now they seem to be in a random timezone... and very inconvenient for discussions like the present one.

Go to your profile and fiddle with the timezones. I'm UTC +1 w/ DST and the forum timestamps are OK.

Offline

#23 2011-05-03 02:32:30

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: Removing conflicting packages

ngoonee wrote:

*Not* removing something that the user has not specified he wants removed.

Each command to pacman 'means' something. This is for the same reason that pacman -R foo doesn't remove foo's dependencies, because -R just means "please remove this package". -Rns means "please remove this package and its unused dependencies.

In the case of pacman -S bar, where bar replaces foo (but changes dependencies), there's ambiguity as to whether the user intends pacman -R or pacman -Rns, so pacman errs on the safe side.

Or, seen differently, if you want the dependency removed you're gonna have to specify that. -S does not. Perhaps you COULD request additional options to -S which would do what you want (doubt it'd have much uptake though).

Technically, the user never specified that he or she wanted the dependencies in the first place; a package that the user wanted pulled in the dependencies.

This doesn't mean that dependencies should be removed automatically, but, as Inxsible noted, users should definitely be warned when a package is orphaned (and possibly asked if it should be removed).


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

Board footer

Powered by FluxBB