Which package recommends a certain other package?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Which package recommends a certain other package?

Werner Flamme
Hi,

the subject is not very clear, I guess, but I miss the right words to
say it in short...

When doing "zypper inr", zypper tries to install the recommended
packages that are not yet installed.

In my case, I get

===snip===
# zypper inr
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 20 NEW packages are going to be installed:
  gstreamer-plugins-bad-lang libreoffice libreoffice-branding-upstream
libreoffice-icon-theme-breeze libreoffice-icon-theme-galaxy
libreoffice-icon-theme-hicontrast libreoffice-icon-theme-oxygen
  libreoffice-icon-theme-sifr libreoffice-l10n-en libreoffice-mailmerge
libreoffice-math libreoffice-pyuno libreoffice-share-linker
lifecycle-data-openSUSE obs-service-format_spec_file
  obs-service-obs_scm-common obs-service-recompress
obs-service-set_version obs-service-source_validator obs-service-tar_scm

20 new packages to install.
===pins===

While it's generally a good idea to recommend the installation of
LibreOffice, I want to avoid it here, since the version 5.3 deployed by
openSUSE does not work for me. I already installed the packages from
libreoffice.org:

===snip===
libreoffice5.3-5.3.5.2-2.x86_64
libreoffice5.3-base-5.3.5.2-2.x86_64
libreoffice5.3-calc-5.3.5.2-2.x86_64
libreoffice5.3-de-5.3.5.2-2.x86_64
libreoffice5.3-dict-de-5.3.5.2-2.x86_64
libreoffice5.3-dict-en-5.3.5.2-2.x86_64
libreoffice5.3-dict-es-5.3.5.2-2.x86_64
libreoffice5.3-dict-fr-5.3.5.2-2.x86_64
libreoffice5.3-draw-5.3.5.2-2.x86_64
libreoffice5.3-en-US-5.3.5.2-2.x86_64
libreoffice5.3-freedesktop-menus-5.3.5-2.noarch
libreoffice5.3-impress-5.3.5.2-2.x86_64
libreoffice5.3-math-5.3.5.2-2.x86_64
libreoffice5.3-ure-5.3.5.2-2.x86_64
libreoffice5.3-writer-5.3.5.2-2.x86_64
===pins===

Now I want to know which package recommends the installation of those
various libreoffice packages. How would I do that?

* I know "rpm -q --requires" and "rpm -q --whatrequires", but those
packages are no requirements.
* There is a "rpm -q --recommands", but this works in the wrong
direction ;).

What could I use instead of the unknown "rpm -q --whatrecommends
libreoffice" (rpm: --whatrecommends: unknown option)?

A "rpm -qa --recommends" generates a lot of output, but applying a "grep
libreoffice" to it is quite senseless :-\

Also, YaST doesn't offer this feature, I can ask only for "Provides" and
"Requires" here.

Only when I go to package "patterns-openSUSE-office", I see that this
package requires libreoffice (also via "rpm -q --recommends
patterns-openSUSE-office"). But this was an easy guess, how can I
proceed in cases that are not so obvious?

Regards,
Werner

--



smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Which package recommends a certain other package?

Manfred Hollstein
Moin,

On Tue, 22 Aug 2017, 08:42:28 +0200, Werner Flamme wrote:
> [..]
> What could I use instead of the unknown "rpm -q --whatrecommends
> libreoffice" (rpm: --whatrecommends: unknown option)?

  zypper se -s --recommends libreoffice

should do what you want.

HTH, cheers.

l8er
manfred

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Which package recommends a certain other package?

Werner Flamme
Manfred Hollstein [22.08.2017 08:50]:

> Moin,
>
> On Tue, 22 Aug 2017, 08:42:28 +0200, Werner Flamme wrote:
>> [..]
>> What could I use instead of the unknown "rpm -q --whatrecommends
>> libreoffice" (rpm: --whatrecommends: unknown option)?
>
>   zypper se -s --recommends libreoffice
>
> should do what you want.
>
> HTH, cheers.
>
> l8er
> manfred
>
Ah, yes, thank you!

In the resulting list, I only have to look for the "i" in the first column.

Werner

--



smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Which package recommends a certain other package?

Werner Flamme
Werner Flamme [22.08.2017 08:54]:

> Manfred Hollstein [22.08.2017 08:50]:
>> Moin,
>>
>> On Tue, 22 Aug 2017, 08:42:28 +0200, Werner Flamme wrote:
>>> [..]
>>> What could I use instead of the unknown "rpm -q --whatrecommends
>>> libreoffice" (rpm: --whatrecommends: unknown option)?
>>
>>   zypper se -s --recommends libreoffice
>>
>> should do what you want.
>>
>> HTH, cheers.
>>
>> l8er
>> manfred
>>
>
> Ah, yes, thank you!
>
> In the resulting list, I only have to look for the "i" in the first column.
>
> Werner
>
Even better: zypper -s -i --recommends :)

Werner

--



smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Which package recommends a certain other package?

Vojtěch Zeisek-2
In reply to this post by Werner Flamme
Dne úterý 22. srpna 2017 8:54:36 CEST, Werner Flamme napsal(a):

> Manfred Hollstein [22.08.2017 08:50]:
> > On Tue, 22 Aug 2017, 08:42:28 +0200, Werner Flamme wrote:
> >> [..]
> >> What could I use instead of the unknown "rpm -q --whatrecommends
> >> libreoffice" (rpm: --whatrecommends: unknown option)?
> >>
> >   zypper se -s --recommends libreoffice
> >
> > should do what you want.
>
> Ah, yes, thank you!
>
> In the resulting list, I only have to look for the "i" in the first column.
zypper se -si ...? # 'i' to list only installed packages

--
Vojtěch Zeisek
https://trapa.cz/

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Which package recommends a certain other package?

Werner Flamme
Vojtěch Zeisek [22.08.2017 08:58]:

> Dne úterý 22. srpna 2017 8:54:36 CEST, Werner Flamme napsal(a):
>> Manfred Hollstein [22.08.2017 08:50]:
>>> On Tue, 22 Aug 2017, 08:42:28 +0200, Werner Flamme wrote:
>>>> [..]
>>>> What could I use instead of the unknown "rpm -q --whatrecommends
>>>> libreoffice" (rpm: --whatrecommends: unknown option)?
>>>>
>>>   zypper se -s --recommends libreoffice
>>>
>>> should do what you want.
>>
>> Ah, yes, thank you!
>>
>> In the resulting list, I only have to look for the "i" in the first column.
>
> zypper se -si ...? # 'i' to list only installed packages
>
Hm, strange things happen ;)

===snip===
# zypper inr
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 8 NEW packages are going to be installed:
  gstreamer-plugins-bad-lang lifecycle-data-openSUSE
obs-service-format_spec_file obs-service-obs_scm-common
obs-service-recompress obs-service-set_version
obs-service-source_validator obs-service-tar_scm

8 new packages to install.
===pins===

===snip===
# zypper se -s --recommends lifecycle-data-openSUSE
Loading repository data...
Reading installed packages...
No matching items found.
===pins===

*scratch head*

The package will be pulled in as a recommended package, but nothing
recommends it? Not even uninstalled packages? I don't understand the
mechanism...

Werner

--



smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Which package recommends a certain other package?

Andreas Schwab-2
On Aug 22 2017, Werner Flamme <[hidden email]> wrote:

> The package will be pulled in as a recommended package, but nothing
> recommends it? Not even uninstalled packages? I don't understand the
> mechanism...

It can be an indirect dependency, by recommending something else that is
provided by the package.

Andreas.

--
Andreas Schwab, SUSE Labs, [hidden email]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Which package recommends a certain other package?

Dominique Leuenberger / DimStar
In reply to this post by Werner Flamme
On Tue, 2017-08-22 at 09:51 +0200, Werner Flamme wrote:

> Hm, strange things happen ;)
>
> ===snip===
> # zypper inr
> Loading repository data...
> Reading installed packages...
> Resolving package dependencies...
>
> The following 8 NEW packages are going to be installed:
>   gstreamer-plugins-bad-lang lifecycle-data-openSUSE
> obs-service-format_spec_file obs-service-obs_scm-common
> obs-service-recompress obs-service-set_version
> obs-service-source_validator obs-service-tar_scm
>
> 8 new packages to install.
> ===pins===
>
> ===snip===
> # zypper se -s --recommends lifecycle-data-openSUSE
> Loading repository data...
> Reading installed packages...
> No matching items found.
> ===pins===
>
> *scratch head*
>
> The package will be pulled in as a recommended package, but nothing
> recommends it? Not even uninstalled packages? I don't understand the
> mechanism...

That is 'reverse' - actually nothing recommends lifecycle-data-
openSUSE, but the package itself recommends its installation based on
other packages being present:

Supplements:    packageand(openSUSE-release:zypper-lifecycle-plugin)

so, as soon as openSUSE-release and zypper-lifecycle-plugin are being
installed on the system, lifecycle-data-openSUSE is being marked as a
recommended package.

Cheers,
Dominique

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Which package recommends a certain other package?

Werner Flamme
Dominique Leuenberger / DimStar [22.08.2017 10:20]:

> On Tue, 2017-08-22 at 09:51 +0200, Werner Flamme wrote:
>> Hm, strange things happen ;)
>>
>> ===snip===
>> # zypper inr
>> Loading repository data...
>> Reading installed packages...
>> Resolving package dependencies...
>>
>> The following 8 NEW packages are going to be installed:
>>   gstreamer-plugins-bad-lang lifecycle-data-openSUSE
>> obs-service-format_spec_file obs-service-obs_scm-common
>> obs-service-recompress obs-service-set_version
>> obs-service-source_validator obs-service-tar_scm
>>
>> 8 new packages to install.
>> ===pins===
>>
>> ===snip===
>> # zypper se -s --recommends lifecycle-data-openSUSE
>> Loading repository data...
>> Reading installed packages...
>> No matching items found.
>> ===pins===
>>
>> *scratch head*
>>
>> The package will be pulled in as a recommended package, but nothing
>> recommends it? Not even uninstalled packages? I don't understand the
>> mechanism...
>
>
> That is 'reverse' - actually nothing recommends lifecycle-data-
> openSUSE, but the package itself recommends its installation based on
> other packages being present:
>
> Supplements:    packageand(openSUSE-release:zypper-lifecycle-plugin)
>
> so, as soon as openSUSE-release and zypper-lifecycle-plugin are being
> installed on the system, lifecycle-data-openSUSE is being marked as a
> recommended package.
>
> Cheers,
> Dominique
>
Cool! Thank you, Dominique, I never knew about this possibility.

Werner
--



smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Which package recommends a certain other package?

David Haller-4
In reply to this post by Werner Flamme
Hello,

On Tue, 22 Aug 2017, Werner Flamme wrote:
>What could I use instead of the unknown "rpm -q --whatrecommends
>libreoffice" (rpm: --whatrecommends: unknown option)?
>
>A "rpm -qa --recommends" generates a lot of output, but applying a "grep
>libreoffice" to it is quite senseless :-\

Well, not really what you need, and that's been solved, but you can
get the info that options give:

rpm -qa --qf '[%{NAME}-%{VERSION}-%{RELEASE}:\t%{RECOMMENDS}\n]' | \
    awk '$2 ~ /libreoffice/ { print; }'

or

rpm -qa --qf '[%{NAME}-%{VERSION}-%{RELEASE}:\t%{RECOMMENDNAME}\n]' | \
    awk '$2 ~ /libreoffice/ { print; }'

See 'rpm --querytags' for more available tags and the rpm-book for how
to generally use the queryformat option. And no, all-uppercase is not
neccessary for the querytags.

You could put that into a script / shell-function, e.g. something
along these lines:

==== ~/bin/rpm-whatrecommends ====
#!/bin/bash
QF='[%{NAME}-%{VERSION}-%{RELEASE}:\t%{RECOMMENDS}\n]'

pat="$1"; shift;
test -z "$pat" && echo "USAGE: $0 'PATTERN' [options/args..]" >&2

rpm -qa --qf "$QF" "$@" | \
    awk -vPAT="$pat" -F':' '$2 ~ PAT { print; }'
====

You could use '{print $1;}' in the awk to just get the package name
and add a 'sort -u' at the end ... ;)

HTH,
-dnh

--
        "Wenn das Wörtchen 'wenn' nicht wär' ,
         wär' die Platte jetzt nicht leer."
                                     -- ratti in suse-linux
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]