Pamac info, getting optional dependency package names?

Hello,

Seeking a way to query pamac to get the actual package names of optional dependencies. pamac info does not (necessarily) return this, correct?

e.g. pamac info vim

Name                  : vim
Version               : 9.1.1734-1
Description           : Vi Improved, a highly configurable, improved version of the vi text editor
URL                   : https://www.vim.org
Licenses              : custom:vim
Repository            : extra
Installed Size        : 5.2 MB
Groups                : --
Depends On            : vim-runtime=9.1.1734-1 gpm acl glibc libgcrypt zlib
Optional Dependencies : python: Python language support [Installed]
                        ruby: Ruby language support
                        lua: Lua language support [Installed]
                        perl: Perl language support [Installed]
                        tcl: Tcl language support [Installed]

(I am assuming ‘ruby language support’ != ruby). Cannot find a ‘ruby language support’ pkg.

Context:

Am trying to script provisioning in ansible, and looking for an unattended way to install optional dependencies. A separate pamac install will work, but I need the actual package name.

Hi @jtuyreqwertyu,

As I understand it, the name of the dependency is before the colon, followed by the description,

So, using your example of ruby, the name of the package is ruby and it provides “Ruby language support”.

7 Likes
1 Like

What @Mirdarthos said - before the colon is the package name, after the colon is the package description.
python, ruby, lua, perl, tcl in this example.
See also the Arch website where the repo packages and the AUR packages are described:

Arch Linux - vim 9.1.1841-1 (x86_64)

You find 25 dependencies for this package, the above five of them being optional,
and many more dependencies needed to be able to build the package,
but not needed to be present after the build (make dependencies).

1 Like

There is a package called pacdep which will probably do what you need it to, though it queries pacman and not pamac.

It is not available in Manjaro repo’s, but can still be found in the AUR, albeit quite old and seemingly unmaintained.

Syntax is simple;

pacdep -oppp <package-name>

which produces output similar to:

...
Optional dependencies:    n.nn MiB
  extra/dependency-name     n.nn MiB
  extra/dependency    n.nn MiB
...

(re-created as I do not have pacdep installed)

As you can see the optional dependency package names output in a format that you can likely work with; assuming it still builds without issue.

I hope this might be workable in the absence of other options.

Regards.

1 Like

Perhaps easier to parse/postprocess than pamac info output is
pacman output

pacman -S --print-format %O vim

will give you:
python: Python language support ruby: Ruby language support lua: Lua language support perl: Perl language support tcl: Tcl language support

It’s from the

TRANSACTION OPTIONS

section in

man pacman

or you parse the local database for the package:

/var/lib/pacman/local/vim-9.1.1734-1/desc

and get

...
%OPTDEPENDS%
python: Python language support
ruby: Ruby language support
lua: Lua language support
perl: Perl language support
tcl: Tcl language support

...
1 Like
$ pamac info ruby
Name                  : ruby
Version               : 3.4.7-1
Description           : An object-oriented language for quick and easy programming
URL                   : https://www.ruby-lang.org/en/
Licences              : BSD-2-Clause
Repository            : extra
Installed Size        : 17.7 MB
Groups                : --
Depends On            : gcc-libs gdbm glibc gmp libffi libxcrypt libyaml openssl readline zlib rubygems
Optional Dependencies : tk: for Ruby/TK [Installed]
                        ruby-docs: Documentation for Ruby
                        ruby-default-gems: Default gems which are part of Ruby StdLib [Installed]
                        ruby-bundled-gems: Bundled gems which are part of Ruby StdLib [Installed]
                        ruby-stdlib: Full Ruby StdLib including default gems, bundled gems and tools [Installed]
Required By           : ruby-abbrev ruby-base64 ruby-bigdecimal ruby-bundler ruby-csv ruby-debug ruby-drb ruby-erb
                        ruby-getoptlong ruby-irb ruby-matrix ruby-minitest ruby-mutex_m ruby-net-ftp ruby-net-imap
                        ruby-net-pop ruby-net-smtp ruby-nkf ruby-observer ruby-power_assert ruby-prime ruby-racc
                        ruby-rake ruby-rbs ruby-rdoc ruby-repl_type_completor ruby-resolv-replace ruby-rexml ruby-rinda
                        ruby-syslog ruby-test-unit ruby-typeprof rubygems
Optional For          : gvim subversion
Provides              : libruby.so=3.4-64 ruby-benchmark ruby-cgi ruby-date ruby-delegate ruby-did_you_mean ruby-digest
                        ruby-english ruby-error_highlight ruby-etc ruby-fcntl ruby-fiddle ruby-fileutils ruby-find
                        ruby-forwardable ruby-io-console ruby-io-nonblock ruby-io-wait ruby-ipaddr ruby-json
                        ruby-logger ruby-net-http ruby-net-protocol ruby-open-uri ruby-open3 ruby-openssl ruby-optparse
                        ruby-ostruct ruby-pathname ruby-prism ruby-pp ruby-prettyprint ruby-pstore ruby-psych
                        ruby-readline ruby-reline ruby-resolv ruby-ruby2_keywords ruby-securerandom ruby-set
                        ruby-shellwords ruby-singleton ruby-stringio ruby-strscan ruby-syntax_suggest ruby-tempfile
                        ruby-time ruby-timeout ruby-tmpdir ruby-tsort ruby-un ruby-uri ruby-weakref ruby-yaml ruby-zlib
1 Like

You already know the answer:

What were you actually trying to do and why did you think that command did not fulfil your query?

1 Like

Thanks. Yes, this is why I assumed the pamac info vim output was not giving the actual package name. I assumed vim ‘language support’ (e.g. I assume linting, syntax highlighting, etc) would not require installation of the full programming language itself. But perhaps this is the case.

Yes it seems my assumption is not actually holding. If vim language support is actually the full ruby programming language install, then that would answer. The package names listed in info are the full package names.

(Not actually true).

Thanks.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.