Install package as a dependency

ompadu

New Member


Messages: 6

Hello, I am coming from Arch Linux and I am trying to find the correct pkg() flag to replicate the pacman -S --asdeps [I]package_name[/I] behavior. Context on what this command is and what am I trying to achieve from the pacman wiki:

Installation reason
The pacman database distinguishes the installed packages in two groups according to the reason why they were installed:

  • explicitly-installed: the packages that were literally passed to a generic pacman -S or -U command;
  • dependencies: the packages that, despite never (in general) having been passed to a pacman installation command, were implicitly installed because required by another package that was explicitly installed.
When installing a package, it is possible to force its installation reason to dependency with:

# pacman -S --asdeps [I]package_name[/I]

[...]

Tip: Installing optional dependencies with --asdeps will cause it such that if you remove orphans, pacman will also remove leftover optional dependencies.

Translating from Arch Linux to FreeBSD:

  • opphan packages in Arch are leaf dependencies in FreeBSD;
  • # pacman -S [I]package_name[/I] is # pkg install [I]package_name[/I]

I'm basically looking to replicate the --asdeps flag behaviour. Thank you!

Disclamer: I am aware that FreeBSD is not GNU/Linux, of FreeBSD's history, and that just because a thing is done in GNU/Linux in a certain way it does not mean it's supposed to be done in the same way in FreeBSD, or that it's supposed to be done at all.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,362
Messages: 38,898

If I read the explanation correctly, you're looking for pkg-set(8). Specifically the automatic flag.

Code:
     -A 01, --automatic 01
                Set automatic flag for the package: 0 is not automatic, 1 is
                automatic.  This affects the operation of pkg-autoremove(8).
 
Top