Install package as a dependency in openSUSE

I moved to openSUSE from Arch Linux, where I could install packages as dependencies or optional with “–asdeps” prefix.

What’s an equivalent to do like that in openSUSE with YaST / Zypper?

Thanks and best regards.

Hello and welcome here.

Maybe you should explain better what that feature does. Those who never used Arch Linux may have no idea what you are after and thus it will be difficult if, and when yes how, you can achive the same result on openSUSE.

Basically, “–asdeps” prefix installs package as a dependency or optional package ( recommends / suggestions).

There are 2 main categories in pacman: explicitly installed and optionally installed / dependencies.

Whenever you remove explicit packages, pacman also removes optionally installed packages and dependencies.

However, if package is optional but you installed it as explicit (without “–asdeps” prefix), pacman won’t automatically delete it, meaning this package would be an orphan remaining in the system.

So, I’m wondering how I may install packages as recommendations / suggestions in openSUSE manually (for example, if they were not installed initially), so zypper could remove them when I delete the main package.

Thanks for the explanation. Nevertheless it is not completely clear to me. That may be because words like “recommended” “dependent”, etc. may have a different technical meaning in the two worlds we are talking about.

In the opensuse (RPM, zypper, YaST) world “dependent” packages are packages needed by other packages for the product in that last package to be able to realy work. E.g. a binary in pcakage A may need a run time library in package B to run at all, thus package B is a dependency of package A (and as such specified inside the RPM of A). (But of course that library can be a dependency of package C also, thus removing package B because you remove package A will break package C).

Also I am not sure about the word “pacman” you use. We know Packman as a repository outside the official openSUSE repositories, that delivers packages not in the standard OSS repo, or working packages for not (fully) working ones. This because openSUSE can not offer them because of restrictions (e.g. on multi-media codecs) that may apply in certain jurisdictions.

Recommended packages are packages that are thought (but this can be arbitrary) of being good to have in a “standard” installation (an installation were the owner does not want to decide for each and every bit of software himself if it is needed). It is a sort of service to the begining user. Most people simly except that list, but you can of course decide to not install then during system installation, or remove them later and (in both cases) block them, because, as recommened packages) they else wll be installed on the first occasion you want to install something else.

Hope this helps in getting to a mutual understanding.

Pacman is Arch Linux’s PACkage MANager.

I’d like to install recommended packages later myself, however, in Arch Linux you have to put manually “–asdeps” option (“asdeps” stands for “as dependency”, which is also not always dependency, it may also be recommended or suggested package), because otherwise, when you remove the main package, those will stay as orphans.

So, speaking of openSUSE, do I have to put some options like that or I may just install them as usual and they will lately be removed automatically when deleting the main package?

By default soft dependencies are installed when you install package that suggests/recommends or supplements them. This can be disabled to install only mandatory dependencies (requires). Dependencies are never removed automatically when you remove package that caused them to be installed. zypper knows whether package was requested explicitly or installed as dependency and I think there is option to remove “unneeded” dependencies, but it is all or nothing.

I’ve been searching on how to mark package as automatically installed (suggestion/recommendation), from what I got there is no way to do that.

Example: I want to install “engrampa” package. I’m not sure why, but for me zypper says:

“The following 5 packages are suggested, but will not be installed:…”

And then there are listed packages like “lzop”, “lhasa” and others to deal with archives.

Then I installed those manually, removed “engrampa” package, and those packages are still remain in my system as orphans (and no, they’re not required or recommended by any other package).

I guess this is problem, and the only thing I can do is just ignore it and manually clean up my system.

This is old but may help:

https://codeghar.wordpress.com/2014/07/23/zypper-cookbook-autoremove-packages-and-remove-orphaned-packages/

if you use Software Manager in Yast you can select what you want (if I understand you correctly). In the menu bar ‘Dependencies’ allows you to toggle on/off ‘install recommended packages’ and ‘Options’ allows you to toggle on/off ‘Clean up when deleting packages’.

Package inventory with zypper is not complete. Any package you name for zypper will be marked as explicitly installed (prefix i+). Default configuration installs recommended packages as implicit dependencies (prefix i). Explicit packages are not reported as unneeded. Implicit packages are reported as unneeded once explicit packages are removed. Suggested packages are not installed automatically.

Some query commands:

echo all installed packages
zypper search -si
echo packages not explicitly installed which are not dependencies of explicit installs
zypper packages --unneeded
echo packages recommended by installed packages
zypper packages --recommended
echo packages suggested by installed packages
zypper packages --suggested
echo packages that don't have a backing repository (check only after a zypper dup)
zypper packages --orphaned

Installation:


echo remove a package and unneeded dependencies
zypper rm -u package_name
echo install all recommended packages, as explicit installs
zypper inr

Thanks, however I haven’t found relevant information there.

Thanks.

Thanks for the write-up, this makes everything clear.

I guess I can mark this thread as solved.