You are not logged in.

#1 2020-10-25 23:57:27

860lacov
Member
Registered: 2020-05-02
Posts: 497

[SOLVED] Managing dependencies questions

I wanted to remove metasploit package
pacman -Rsn metasploit

:: libreoffice-fresh optionally requires postgresql-libs: for postgresql-connector
:: qt5-base optionally requires postgresql-libs: PostgreSQL driver
:: vim optionally requires ruby: Ruby language support
warning: dependency cycle detected:
warning: ruby-irb will be removed after its ruby dependency
warning: dependency cycle detected:
warning: ruby-reline will be removed after its ruby dependency
warning: dependency cycle detected:
warning: rubygems will be removed after its ruby dependency

Packages (8) inetutils-1.9.4-8  postgresql-libs-12.4-1  ruby-2.7.2-1  ruby-bundler-2.1.4-1  ruby-irb-1.2.7-1
             ruby-reline-0.1.6-1  rubygems-3.1.4-1  metasploit-5.0.101-1

I'm not sure but I think that all packages were installed with metasploit.

1. Is it always safe to remove optional dependencies?
2.
If I install vim without optional dependency [Ruby].
Then I'll install metasploit with Ruby
Then I'll remove metasploit.

Will I always have warning that Ruby is  a optional dependency of Vim?

3. How can I check if Ruby was installed with vim or metasploit?
4. I probably will not use this but how can I install package with all optional dependencies?

Last edited by 860lacov (2020-10-26 16:53:54)

Offline

#2 2020-10-26 00:46:16

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

Re: [SOLVED] Managing dependencies questions

860lacov wrote:

1. Is it always safe to remove optional dependencies?

That depends on your definition of safe: do you need the optional features provided by those optional deps?

860lacov wrote:

2. ...Will I always have warning that Ruby is a optional dependency of Vim?

If by "always" you mean in the transaction when you remove Ruby, then yes.  It will not show up in any other pacman output.

860lacov wrote:

3. How can I check if Ruby was installed with vim or metasploit?

You can't, because it wasn't - the distinction is meaningless.  Packages are not installed with anything: they are simply either installed as an explicit package or as a dependency.  In theory you could read your pacman log to check when a package was installed and check if you installed it at the same time as another package - but other than that log, there is no metadata to address this question.

860lacov wrote:

4. I probably will not use this but how can I install package with all optional dependencies?

I don't believe there is any automatic way to do so (because it'd pretty much be a bad idea).

Oddly, none of these questions relates in any way to your title.  Please change your title to something that represents what you wanted to know about. (edit: thanks this title fits well)

I also suspect you may want to read up about the difference between an explicitly installed package and packages installed as dependencies.  If you decide you want some optional dependencies for a package, you generally would (and should) install them explicitly.  And when you do this, most of the questions you raise above become irrelevant: if you installed ruby explicitly in order to add the optional capabilities for vim, then removing metasploit would not give you the option to remove ruby and none of these messages would appear.

Last edited by Trilby (2020-10-26 13:21:00)


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

Offline

#3 2020-10-26 08:27:50

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: [SOLVED] Managing dependencies questions

Trilby wrote:
860lacov wrote:

1. Is it always safe to remove optional dependencies?

That depends on your definition of safe: do you need the optional features provided by those optional deps?

Thank you for all answers.

I don't know if I'll gonna to need those futures. Didn't know of theirs existence till now so probably I don't need them.

Let me rephrase this part.

Let's say I have this situation:

  • I have package A. It has optional dependencies. [optional dependencies are not installed]

  • I'm installing package B that depends on package C

  • Package C is optional dependency of package A

  • When I'll try to remove package B with pacman -Rsn I'll get notification from pacman that there is dependency cycle detected and during package B removal the Package C which is Package A optional dependency will be removed

After B and C removal package A should work like before installation of B,C

Do I get it right?

Offline

#4 2020-10-26 13:20:36

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

Re: [SOLVED] Managing dependencies questions

860lacov wrote:

After B and C removal package A should work like before installation of B,C

Do I get it right?

Correct.


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

Offline

Board footer

Powered by FluxBB