You are not logged in.

#1 2011-08-18 09:10:23

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

can pacman automatically resolve package conflicts?

I hope the "installation" area is the right place to discuss Pacman ;

Is there a way for Pacman to resolve conflicts between implied packages (e.g. those included by a group like base) and other packages explicitly listed in the command line arguments?

For example, if I do

pacman -S base fcron

I get this error

resolving dependencies...
looking for inter-conflicts...
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: cronie and fcron are in conflict (cron)

Given I didn't explicitly specify cronie it would be good if Pacman could realise that fcron and cronie both satisfy the same dependency (cron) and would therefore drop cronie to resolve the conflict with fcron.

I know I can get round the problem by issuing two separate pacman commands but I'm trying to do this in a script that builds a package list for a complete system for a specific purpose as defined by a set of definition profiles and then installs the lot with one call to Pacman.

Can Pacman do this now and I just haven't realised how, or would this sound like a reasonable enhancement request ?

Thanks.

Offline

#2 2011-08-18 09:22:04

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

Re: can pacman automatically resolve package conflicts?

starfry wrote:

I hope the "installation" area is the right place to discuss Pacman

You know that there is also a Pacman subforum right? wink


ᶘ ᵒᴥᵒᶅ

Offline

#3 2011-08-18 09:45:46

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

Re: can pacman automatically resolve package conflicts?

litemotiv wrote:

You know that there is also a Pacman subforum right? wink

Er, I somehow didn't see that when I looked. I have no idea why that was wink
Can this be moved to "Pacman & Package Upgrade Issues" ?

Offline

#4 2011-08-18 09:47:42

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: can pacman automatically resolve package conflicts?

starfry wrote:

Can this be moved to "Pacman & Package Upgrade Issues" ?

Done!


To know or not to know ...
... the questions remain forever.

Offline

#5 2011-08-18 09:49:04

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: can pacman automatically resolve package conflicts?

The  best for you now would be to download the PKGBUILDs (via ABS) for both fcron and cronie, see if there is anything going wrong and then report back.

EDIT, Offtopic: Eh, staff here changes faster than the weather lately oO

Last edited by Awebb (2011-08-18 09:50:00)

Offline

#6 2011-08-18 12:04:39

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

Re: can pacman automatically resolve package conflicts?

Awebb wrote:

The  best for you now would be to download the PKGBUILDs (via ABS) for both fcron and cronie, see if there is anything going wrong and then report back.

They both provide cron (dcron is yet another cron) so nothing's wrong.

What you want is some kind of transaction processing, but pacman sees only a bunch of packages you do need to use two commands, first one for installing base, later getting e.g. fcron.

Last edited by karol (2011-08-18 12:05:52)

Offline

#7 2011-08-18 13:30:41

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

Re: can pacman automatically resolve package conflicts?

Nothing's wrong, I was just hoping Pacman could know that I never asked for cronie but did ask for another cron (fcron, dcron, whatever) and would intelligently not include already satisfied dependencies when expanding a group.

I can and am doing this with two commands but, like I said, this is for a scripted system builder where the package list is not defined by the coding but by nested profiles. Because I can't tell in the code whether a package should supersede one that is part of a group I don't know which packages need to be done separately. The ultimate conclusion of that is to install every package specified in the profile with its own pacman command. This is what I'll probably end up doing but it just feels less efficient.

The cronie/fcron thing is just an example. This could be any package that happens to be a replacement for one in a group.

I had hoped that pacman might be able to intelligently see that it has been asked to install a package that replaces one in a group it's also been asked to install.

I'm probably not explaining it very well neutral

Offline

#8 2011-08-18 13:39:59

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

Re: can pacman automatically resolve package conflicts?

starfry wrote:

I'm probably not explaining it very well :|

I know what you're talking about, but pacman doesn't yet have any notions of transactions, so it just installs a bunch of packages.
Transactions could mean it looks at the whole command - here: 'pacman -S base fcron' - and does the smart thing, i.e. replaces cronie w/ fcron.
It would also mean that e.g. the font db doesn't get refreshed after every font you install e.g. 'pacman -S font1 font2 ... font123' but only once at the end.
https://bugs.archlinux.org/task/9694
https://bugs.archlinux.org/task/8585

Last edited by karol (2011-08-18 13:41:20)

Offline

#9 2011-08-18 14:12:57

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

Re: can pacman automatically resolve package conflicts?

This isn't something pacman currently does, but it can be done in a single command:

pacman -S base fcron --ignore cronie

Offline

#10 2011-08-18 14:13:57

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

Re: can pacman automatically resolve package conflicts?

falconindy wrote:

This isn't something pacman currently does, but it can be done in a single command:

pacman -S base fcron --ignore cronie

But you have to manually resolve this.

Offline

#11 2011-08-18 14:22:56

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

Re: can pacman automatically resolve package conflicts?

falconindy wrote:
pacman -S base fcron --ignore cronie

I'm going to give that a try. That sounds like a reasonable compromise to me smile

karol wrote:

But you have to manually resolve this.

Or does that mean it won't work in a script...?

Well I'll give it a try later to day anyway...

Last edited by starfry (2011-08-18 14:24:15)

Offline

#12 2011-08-18 14:26:06

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

Re: can pacman automatically resolve package conflicts?

I mean: you have to know what conflicts are there, it's not automatic. It should work the same way using two commands works.

Offline

#13 2011-08-18 19:39:20

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

Re: can pacman automatically resolve package conflicts?

Ok, tried the --ignore option. I get this.

:: Synchronising package databases...
downloading core.db...
downloading extra.db...
downloading community.db...
:: cronie is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] 
resolving dependencies...
looking for inter-conflicts...
error: unresolvable package conflicts detected
:: cronie and fcron are in conflict (cron)
error: failed to install all packages

I'm actually not using pacman directly here but via mkarchroot - sorry for not mentioning before. yikes The exact command being used is like the below example:

mkarchroot template.x86_64 base fcron --ignore cronie openssh 

The prompt "cronie is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] " is being answered in the default "Y" automatically. I need this to default to "N"

I've tried adding --noconfirm but it makes no difference.

Offline

#14 2011-08-18 19:46:44

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

Re: can pacman automatically resolve package conflicts?

Which version of pacman are you using?

Offline

#15 2011-08-18 20:45:21

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

Re: can pacman automatically resolve package conflicts?

I should be pretty much bang up to date smile

# pacman -V

 .--.                  Pacman v3.5.4 - libalpm v6.0.4
/ _.-' .-.  .-.  .-.   Copyright (C) 2006-2011 Pacman Development Team
\  '-. '-'  '-'  '-'   Copyright (C) 2002-2006 Judd Vinet
 '--'
                       This program may be freely redistributed under
                       the terms of the GNU General Public License.

#

Offline

#16 2011-08-20 09:28:19

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

Re: can pacman automatically resolve package conflicts?

Well, the workaround I am using is below. I think it's ugly but it works. I have to let the unwanted implied packages install and then manu
ally replace them. In a script the only hands-off way I can find to make this happen is with the below ugly command:

# yes | pacman -S fcron
resolving dependencies...
looking for inter-conflicts...
:: fcron and cronie are in conflict (cron). Remove cronie? [y/N] 
Remove (1): cronie-1.4.8-1

Total Removed Size:   0.18 MB

Targets (1): fcron-3.0.6-4

Total Download Size:    0.00 MB
Total Installed Size:   1.21 MB

Proceed with installation? [Y/n] (0/1) checking package integrity                                         [--------------(1/1) checking pac
kage integrity                                         [#########################################] 100%
(1/1) checking for file conflicts                                        [#########################################] 100%
(1/1) removing cronie                                                    [#########################################] 100%
(1/1) installing fcron                                                   [#########################################] 100%

I think there are two problems with how it works today.

1. it isn't possible to replace packages in a group with specific alternatives in one command
2. the default option when requesting an --ignore is to not ignore. I think this is particularly crazy since I explicitly told the command
to ignore that package.

I'm happy to raise these in bug/enhancement request tracking if you can guide me in the right direction.

Thanks.

Last edited by starfry (2011-08-20 10:14:44)

Offline

#17 2011-08-20 09:54:25

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

Re: can pacman automatically resolve package conflicts?

I think 'yes | pacman -S fcron' / 'echo no | pacman ...' is how we do it right now. You can open a bug report https://bugs.archlinux.org/index.php?project=3

Offline

#18 2011-08-20 10:15:25

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

Re: can pacman automatically resolve package conflicts?

will do, thanks. much appreciated.

(done FS#25691)

Last edited by starfry (2011-08-20 15:56:34)

Offline

Board footer

Powered by FluxBB