You are not logged in.

#1 2022-02-09 05:04:50

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

[Solved] List optional dependencies after large update

Frequently in running pacman, the package offers typically (example):

Optional dependencies for blahpack
    pulseaudio: Audio support [installed]
    speech-dispatcher: Text-to-Speech

I may be blind and illiterate, but reading the man pages for pacman and paru do not provide the answer:

How do I get the software to AUTOMATICALLY build speech-dispatcher? Or am I making an enhancement request?

Last edited by OrigBitmancer (2022-02-10 13:55:30)

Offline

#2 2022-02-09 05:08:44

thehexagon
Member
From: New Zealand
Registered: 2020-10-26
Posts: 76
Website

Re: [Solved] List optional dependencies after large update

I'm assuming you want to install the package, like how it says pulseaudio is installed. To do that, just run this command

$ sudo pacman -S speech-dispatcher

I do feel like that isn't what you want though...

Last edited by thehexagon (2022-02-09 05:09:02)


NZ - UTC+12, or UTC+13 (depends on DST) | HP ENVY x360 2-in-1 Laptop 15-EW0009TX

Offline

#3 2022-02-09 05:11:45

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] List optional dependencies after large update


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2022-02-09 21:12:37

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] List optional dependencies after large update

No, @thehexagon, that is not what I want. You are right.

This indicates that the answer has been looked around since 2013. That is Not Good.

OTOH, it also shows that the pacman(8) code itself is capable of determining the "optional requirement" in several places.

I should get in touch with the maintainers, and perhaps contribute a code snippet.

Thanks to both of you for chiming in. I shall close this for now. If I get response from the maintainers, I shall update it.

Offline

#5 2022-02-09 21:21:28

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,694

Re: [Solved] List optional dependencies after large update

Pacman doesn't build anything.

If you're asking how to make it automatically install optional deps, it can't.

Online

#6 2022-02-09 21:27:33

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] List optional dependencies after large update

Scimmia wrote:

Pacman doesn't build anything.

If you're asking how to make it automatically install optional deps, it can't.

Well, this was not helpful. Perhaps a semantic issue? Common English slang bias?

If you would like me to rephrase, "build speech-dispatcher" would become "command the construction and installation of speech-dispatcher". Is that better?

Offline

#7 2022-02-09 21:29:47

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,694

Re: [Solved] List optional dependencies after large update

The "construction", or building the package, isn't done by pacman at all. It takes pre-build, binary packages and installs them, that's all.

Online

#8 2022-02-09 21:34:30

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] List optional dependencies after large update

Scimmia wrote:

The "construction", or building the package, isn't done by pacman at all. It takes pre-build, binary packages and installs them, that's all.

Since my verb choice and noun choice are obviously bothering you, please suggest corrections.

Offline

#9 2022-02-09 21:41:45

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] List optional dependencies after large update

OrigBitmancer wrote:

How do I get the software to AUTOMATICALLY build speech-dispatcher? Or am I making an enhancement request?

All packages in the official repos have already been 'built', but this is nothing to do with pacman.
All pacman does is download already built packages and install them onto your system.
If you want to install the speech-dispatcher package then simply run the command...

pacman -S speech-dispatcher

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#10 2022-02-09 22:02:23

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] List optional dependencies after large update

Slithery wrote:
OrigBitmancer wrote:

How do I get the software to AUTOMATICALLY build speech-dispatcher? Or am I making an enhancement request?

All packages in the official repos have already been 'built', but this is nothing to do with pacman.
All pacman does is download already built packages and install them onto your system.
If you want to install the speech-dispatcher package then simply run the command...

pacman -S speech-dispatcher

Oh, dear.

I encountered this situation when rebuilding a system. Inside the report of execution of pacman, there were a number of Optional Dependencies for many packages. In many cases, adding those packages would be desirable enhancements to extant software. I wanted (at least) to have pacman create a list of those packages, so I could consider adding them to the system.
In the case I presented, I wanted pacman to cause

pacman -S speech-dispatcher

to happen. It was merely an illustration.

Since I had not misinterpreted an option that already existed, and there was not heated discussion about adding this feature to the pacman command, others pointed me to more helpful discussion.

There seems to be a game of "troll the American" going on, here. It is very unprofessional. Please stop?
If I am wrong, then please accept my apologies.

Offline

#11 2022-02-09 23:17:02

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] List optional dependencies after large update

OrigBitmancer wrote:

There seems to be a game of "troll the American" going on, here. It is very unprofessional. Please stop?

There has been absolutely nothing of the sort that that would suggest that happening here. We have users from all over the globe.
As explained in the provided documentation for Arch Linux...

About Arch wrote:

It is targeted at the proficient GNU/Linux user,

A proficient Linux user isn't someone that doesn't know the difference between binary distros and source based distros, Everything in this thread has been informational, none of it has been negative.
I do apologise if you have  taken any of the posts in this thread the wrong way.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#12 2022-02-09 23:35:04

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,556

Re: [Solved] List optional dependencies after large update

OrigBitmancer wrote:

I may be blind and illiterate, but reading the man pages for pacman and paru do not provide the answer:

That's correct this is like other people already said not pacman's case.
You look at the PKGBUILD manual.
It clearly says 'optdepends' are not essential to base functionality.
If you think this is wrong you can create your own PKGBUILD and add whatever you like to the depends array:-)

Offline

#13 2022-02-09 23:45:22

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,694

Re: [Solved] List optional dependencies after large update

I will also say that unconditionally installing all optional deps is a bad idea. Take dkms for example, you install it and it pulls in all the headers for every kernel in the repos? Nope.

Optional deps are meant for you to read and evaluate.

Online

#14 2022-02-09 23:50:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [Solved] List optional dependencies after large update

Odd thread.  Indeed no one is being "negative" but there does seem to be a lot of avoidance of the actual question which is whether there is a way to have optional dependencies automatically installed.  The answer to that is simply that at present, there is not.  There are a number of ways this could be scripted into a pacman wrapper, but pacman - as far as is documented - provides no such option.

However, another oddity is from the link JWR provided:

Allan's  OptDep wiki page wrote:

Other Ideas
- A flag/configuration option to install a packages optdepends by default [done]

done?  That doesn't appear to be done.  Not unless there is an undocumented flag/configuration for pacman.  But this is what the OP is asking about.

EDIT: oops.  Towards the top of that page it defines "[done]" as meaning it is implemented in a separate branch of a specific repo of the pacman code.

Last edited by Trilby (2022-02-09 23:52:44)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#15 2022-02-09 23:51:41

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] List optional dependencies after large update

Well, "doesn't know the difference between binary distros and source based distros" is somewhat overbearing, if not insulting.

None of the posts since #4 has made a direct contribution. Here is one:
from https://confluence.jaytaala.com/display … ed+distros

sudo pacman -S --asdeps --needed $(pacman -Si wine | sed -n '/^Opt/,/^Conf/p' | sed '$d' | sed 's/^Opt.*://g' | sed 's/^\s*//g' | tr '\n' ' ')

Replace pacman -Si wine with pacman -Si <package> where <package> is the package you want to install all the optional dependencies for.

commenter wrote:

Unfortunately the code you suggested also removes the first optional dependency due to the greedy match of the ':'. Also you leave the description in, which messes things up a bit, and the None keyword if there are no dependancies. A better way, which also allows for you to specify multiple packages, and specify packages to ignore is:

sudo pacman -s --asdeps --needed $(echo $(pacman -Si <SPACE SEPARATED LIST OF PACKAGES> | sed -n '/^Opt/,/^Conf/p' | sed '$d' | sed 's/\(^Opt[^:]*:[[:blank:]]\)//g' | sed 's/: .*$//g' | sed 's/^Conflicts With.*$//g' | sed 's/^None.*$//g' | sed 's/^\s*//g'| tr '\n' ' ' | sed 's/ / /g') | sed 's/<PACKAGE TO IGNORE 1>//g' | sed 's/<PACKAGE TO IGNORE 2>//g' <REPEAT SED FOR ALL IGNORED PACKAGES> | sed 's/<PACKAGE TO IGNORE n>//g' )
ajw107 (Alex)

Perhaps, it would help to have the optdeps put out at the end of a multiple-package command, instead of the middle? Maybe that is my ultimate request.
As

Scimmia wrote:

Optional deps are meant for you to read and evaluate.

Which would be served by that output.

Offline

#16 2022-02-09 23:58:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [Solved] List optional dependencies after large update

That chain of sed commands quoted above is pretty ugly.  If you really want to do something like that use expac:

pacman -S --asdeps --needed $(expac -S %o wine)

If you are really set on parsing the pacman output with sed, then the following would work:

pacman -S --asdeps --needed $(pacman -Si wine | sed -n '/^Optional Deps/{s/[^:]*: \([^:]*\).*/\1/p;:a;n;/^[A-Z]/q;s/:.*//p;ba;}')

But if this is for an already installed package, it'd be easier to parse the local desc file:

sed -n '/%OPTDEPENDS%/{:a;n;/^$/q;s/:.*//p;ba;}' /var/lib/pacman/local/${pkgname}-${pkgver}/desc

Last edited by Trilby (2022-02-10 00:04:48)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#17 2022-02-10 00:04:31

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,556

Re: [Solved] List optional dependencies after large update

OrigBitmancer wrote:

Perhaps, it would help to have the optdeps put out at the end of a multiple-package command, instead of the middle? Maybe that is my ultimate request.

While I think this is nitpicking you forget the first part of Scimmia's post(& agree with that) and I forgot to add to mine

Scimmia wrote:

I will also say that unconditionally installing all optional deps is a bad idea.

So you evaluate if you need it and explicitly install it.

Offline

#18 2022-02-10 07:06:47

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] List optional dependencies after large update

The ultimate result is "make pacman optionally place a list of the optional dependencies in a file"
so that the result can be edited for unnecessary or unwanted packages.

Offline

#19 2022-02-10 13:00:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [Solved] List optional dependencies after large update

expac %o > file

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#20 2022-02-10 13:53:41

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] List optional dependencies after large update

Trilby wrote:
expac %o > file

YES!!! That is it!
After several tries to find out what I needed, I reduced the question to essence, and you answered.
I will restate the title as “List of optional dependencies after large update?”
Thanks again, Trilby!

Offline

Board footer

Powered by FluxBB