Hi,
On Tue, 28 Mar 2023, Lone_Wolf wrote:
On 28-03-2023 14:42, Ralph Corderoy wrote:
Hi LW,
If I wanted to duplicate the packages from one machine to another
then I'd like the method to not alter the source machine, preserve
my choices, and that some packages weren't explicitly wanted.
In other words, duplicate.
...
...could you explain what you do want to achieve ?
Well, I'm not the original OP but I have wondered about how to do this
in the past.
‘pacman -Qqe’ lists the packages I've explicitly installed; call that
set E.
If the dependencies of those refer to a virtual package and I satisfied
it in the past on machine A by choosing package P then I don't think
that adds P to the explicitly installed set.
correct
On machine B, I want to explicitly install package set E and have the
choice of P made automatically. I don't want to make P explicitly
installed on either machine A or B because it is just a dependency.
At every pick-a-package question on B, I could look on A to see how to
re-make the same choice as before but that assumes A is available and is
a tedious manual procedure.
Hope that's clearer. Perhaps I've a faulty assumption early on which
makes my problem disappear.
Yup, much clearer.
Pacman only has one mechanism to automate choices : --noconfirm .
It is intended for scripts to answer pacman y/n questions and execute the
default option.
I am not 100% sure but do think it also does the same for N providers
avaiiable for X questions and chooses the first (alphabetically) one in the
providers list.
Whether that is a good choice is another question .
vulkan-driver is an example were the first choice is amdvlk and choosing this
will often give problems with vulkan later. (just search the forum, plenty of
people that choose that without considering if it was the correct choice)
The correct answer to those N / X questions depends on factors unknown to
pacman and is very hard to automate .
A possible workaround could be to identify the virtual provides and choose a
sensible provider for them.
Those sensible choices would be entered in a set F that will be installed
with --asdeps BEFORE set E.
for vulkan-driver the sensible provider could be vulkan-swrast which uses the
porcessor to implement vulkan support in software and should work on every
system running archlinux.
My solution would be to do a "pacman -S --asdeps" with the list of *all*
packages installed as dependencies (output of "pacman -Qqd" - set D), and
then a "pacman -S --asexplicit" with just the set E (output of "pacman
-Qqe"). Note, that if a package was installed as a dependency of some
package from set D, but is itself not in D but rather in E, it will be
reinstalled in the second step (no big issue, but pacman hooks might
trigger again).
LW
regards,
Erich