You are not logged in.
Hi,
I need to install a custom package which has dependencies that conflict with some packages that are already on the system (and I get the system as an image, so I can't uninstall them beforehand).
I must install this package automatically (it happens on a CI system).
The problem:
* If I do `pacman -U --nocofirm package.pkg.tar.xz`, the installation fails, as the default option is to keep the conflicting packages installed.
* If I do `yes | pacman -U package.pkg.tar.xz`, the installation fails, as some of the dependencies can be provided by several sources, and a number needs to be specified instead of y/n.
What can be done in such a case?
Last edited by blochl (2019-05-29 11:08:46)
Offline
Install the correct dependencies first before installing your custom package?
Offline
Try this:
yes 2|pacman -U package.pkg.tar.xz
The 2 is to be read as an example.
Offline
Possibly implementing the -d or "twice" option? For either prior removal or installation.
Preemptively advising for regular use: "Don't do this"
EDIT :
I must install this package automatically (it happens on a CI system).
I initially read this as you want to do this in a script, although the "it happens on a CI system" seems like you may be doing it manually on the cl.
If scripted, might consider the -d options. If manually on the cl, definitely go with Slithery's advice, "Install the correct dependencies first".
Last edited by NuSkool (2019-04-25 18:10:22)
Offline
Thanks for your help!!
Install the correct dependencies first before installing your custom package?
That would be awesome, but it all needs to be automatic.
Try this:
yes 2|pacman -U package.pkg.tar.xz
The 2 is to be read as an example.
This will just repeat the number. I need it to return the number "1" (1 is always the default, right?) each time it asks for a number, and "y" each time it asks for [y/N] or [Y/n]...
Hmmm... maybe something with `expect`... I just thought about it now - will look into it.
Possibly implementing the -d or "twice" option? For either prior removal or installation.
But I actually want to remove the conflicting packages, not to ignore them.
Offline
it all needs to be automatic
Are you scripting this? What is "needs to be automatic"?
-R <conflicting>, then -U <package> .
If pacman won't remove conflicting packages because of dependencies, and removing them won't kill your system, consider the -d options.
Last edited by NuSkool (2019-04-25 18:26:02)
Offline
Thanks for your help!!
Slithery wrote:Install the correct dependencies first before installing your custom package?
That would be awesome, but it all needs to be automatic.
I didn't mean to do it manually, just fire off the correct pacman command from whichever script then goes on to install the package.
Offline
Can you not provide an example of the actual command used and the output it generates? Also is the arch install on the image base plus base-devel?
Offline
loqs, the OP is installing a custom package, not building it - so base-devel is not necessary.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Biochi, you could ABUSE the conflicts+replaces arrays to achieve automatic removal.
Keep in mind that this is completely unsupported and may cause severe breakage.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
Sorry for abandoning this - I followed here for the first week or so, trying to apply your suggestions, but nothing worked like I wanted, then I found a solution which worked for me, and while testing it (few more days), I forgot about this thread somehow.
So the solution I came up with is removing the `conflicts` from the problematic dependency, and after installing my custom package, just removing the conflicting package in the same script. As easy as that. The dependency is modified by me as well, so it's not a problem to edit its PKGBUILD.
This worked for this particular case, as this dependency could actually be installed alongside the package it conflicts with, so removing the conflicting package after the installation worked fine.
Marking as solved.
Offline