(Please note that this is not a question about libreoffice and ibus, those packages are just examples. I want to understand how zypper works.)
$ zypper install libreoffice
yields
Loading repository data…
…]
The following 41 NEW packages are going to be installed:
firebird ibus ibus-gtk …]
After the installation, how can I see that ibus was installed because of that?
(I hoped that $ zypper info --requires libreoffice would then list ibus, but it doesn’t (at least not verbatim).)
Also, after
$ zypper remove ibus
everything still seems to be fine:
$ zypper verify
…] Dependencies of all installed packages are satisfied.
$ zypper install libreoffice
…] Nothing to do.
If libreoffice doesn’t need ibus, why was it installed during the initial installation?
Also, If I want to reinstall all packackes that came with the initial installation and were removed in the meantime, how can I do that?
(I tried $ zypper info --suggests libreoffice and $ zypper info --recommends libreoffice but there is no hint towards ibus that i can see.)
$ zypper remove ibuseverything still seems to be fine:
$ zypper verify
...] Dependencies of all installed packages are satisfied.
$ zypper install libreoffice
...] Nothing to do.
Try
zypper inr
Also, If I want to reinstall all packackes that came with the initial installation and were removed in the meantime, how can I do that?
If “initial installation” means “the first installation of some package” - “zypper inr package” should do it.
EDIT
Sorry, I always forget that install-new-recommends does not really take any package name. It is global. So no, there is no easy way to reinstall non-required packages for one package only - it is all or nothing,
In a very strict interpretation of these questions, you’ll find answers in /var/log/zypp/history, because the state of package repository was likely to be different than the state of today. Package’s dependencies change all the time. That said, you’ll find that a package will be installed because:
it was explicitly requested;
provides a required dependency of (1)
provides a recommended dependency of (1)
supplements a dependency of (1)
it’s in turn a direct dependency of either (2)(3)(4)
and so on and so forth…
as long as the package doesn’t pose a conflict for the solver
(I don’t claim this is an extensive description, but should be close enough)
It might not be possible to replicate the initial installation today, because of (7), nor automatically, because dependencies are added/removed over time.
Understanding Zypp and Zypper involves realising that, they’re a front end for the Red Hat Package Manager – RPM.
[ul]
[li]Not all the RPM options are visible in Zypper … [/li][li]RPM has a Package Dependencies feature which , is heavily used by most RPM based distributions, including openSUSE … [/li][li]To understand a packages dependencies, you have to delve into the following RPM select options:[/li][LIST]
[li]–whatprovides [/li][li]–whatrequires [/li][li]–whatrecommends [/li][li]–whatsuggests [/li][li]–whatsupplements [/li][li]–whatenhances [/li][/ul]
[li]There are also the following RPM query dependencies:[/li][ul]
[li]–conflicts [/li][li]–enhances [/li][li]–obsoletes [/li][li]–provides [/li][li]–recommends [/li][li]–requires [/li][li]–suggests [/li][li]–supplements [/li][/ul]
[/LIST]
Do you mean the original package versions or, some packages which were “accidentality” removed or, those packages which have been removed due to the security repair patches and updates made during the life of of the distribution version?
[HR][/HR]Despite your question, my answer is, look into the YaST Software Manager: <https://doc.opensuse.org/documentation/leap/startup/html/book.opensuse.startup/part-reference-software.html>
[ul]
[li]Section: “Installing or Removing Software”. [/li][li]Subsection: “Using the YaST Software Manager” – “Views for Searching Packages or Patterns”: <https://doc.opensuse.org/documentation/leap/startup/html/book.opensuse.startup/cha-yast-software.html#sec-yast-software-search>. [/li][/ul]
What you need is, the view “Patterns” – for each group of packages, you’ll find there are special packages with “patterns” in the name – forcibly re-install the “Patterns” packages and then, all the dependent packages, each with their dependencies, within each Pattern will be reinstalled – either using the newest versions available in the Update Repositories or, using the “original” version if there weren’t any patches or updates since the distribution’s beginning (of life) …
Thank you for the explanation.
Also thanks to arvidjaar, karlmistelberger and awerlang for the hints to zypper info --supplements ibus, zypper inr , zypper rm --dry-run --clean-deps libreoffice and /var/log/zypp/history.
With the combination of all this I can achieve what I wanted.
This.
(I want to keep my system clean and be able to remove unused packages but I don’t want any packages that I actually or eventually use to be non-optimal. I guess, zypper inr is perfect for that.)