Installing packages
Install a package¶
When you don't need a specific version of a package, you can install a package...
... using only default values¶
To install one of the available packages without any customization, all you need to do is specify the full name for the package:
> bring install binaries.fd Task: installing package 'fd' Variables arch x86_64 origin: index defaults os unknown-linux-gnu origin: index defaults, from alias: linux pkg binaries.fd origin: user input target ~/.local/bring origin: index defaults target_config -- no value -- transform -- no value -- version 8.1.1 origin: package defaults, from alias: latest Progress - installing pkg 'fd' -> done - gathering file(s) for package 'fd' -> done - downloading file: https://github.com/sharkdp/fd/releases/download/v8.1.1/fd-v8.1.1-x86_64-unknown-linux-gnu.tar.gz -> done - extracting archive (disregarding root folder, only using contents of it) -> done - validating package content -> done - merging files into folder '~/.local/bring' -> done Result: - merged items into '/root/.local/bring': fd: merged
bring always tries be as clear as possible as to what it is doing, which is why it prints the values it ends up using, as well as their origin.
For example, as you can see from the output of that command, the fd binary file was installed into the local $HOME/.local/bring folder. This is because that is the default folder for the binaries index (check the 'explain' command documentation on how to get that information). In addition to the target default, that index also comes with a set of auto-generated default values that describe the OS and architecture of the system bring is running on (which is helpful to pick the right version of a binary, for example).
In some cases the default target might not be suitable for you though. In that case, you can install the package...
... into a specific folder¶
If you need to install a package into a specific directory, use the --target parameter:
> bring install --target /tmp/bring binaries.fd Task: installing package 'fd' Variables arch x86_64 origin: index defaults os unknown-linux-gnu origin: index defaults, from alias: linux pkg binaries.fd origin: user input target /tmp/bring origin: user input target_config -- no value -- transform -- no value -- version 8.1.1 origin: package defaults, from alias: latest Progress
... ... ...
Result: - merged items into '/tmp/bring': fd: merged
The target folder, as well as any intermediate ones, will be created in case they don't exist yet.
If you don't specify the --target parameter, and the index does not have a default target set, the files will be copied into a temporary directory somewhere under ~/.local/share/bring/workspace/results/:
> bring install kubernetes.cert-manager Task: installing package 'cert-manager'
... ... ...
Result: - merged items into '/root/.cache/bring/workspace/results/install__ghg40ka7': cert-manager.yaml: merged
To have more fine-grained control of the version of the package to install, you have to use the install command...
... with arguments¶
Packages often come in different flavours (e.g. which architecture, OS, etc.), as well as several versions, which can be specified in the install command after the package name. Depending on the index configuration, bring assumes certain default values which often make it so that no package arguments at all need to be provided.
But, often it is advisable to specify the exact version of a package to install. If that is desired, you can use the --help parameter (after the package name) to get bring to display information about the supported arguments:
> bring install binaries.fd --help
Usage: bring install binaries.fd [OPTIONS]
Options:
--arch ARCH The architecture the binary is built for.
--os OS The operating system to run on.
--version VERSION The version of the package.
-h, --help Show this message and exit.
To check which values are allowed, the explain subcommand is often useful (like the one we used here).
To illustrate, the following is an example showing how to specifically install version '7.1.0' of the Mac OS X variant of fd:
> bring install binaries.fd --version 7.1.0 --os darwin Task: installing package 'fd' Variables arch x86_64 origin: index defaults os apple-darwin origin: user input, from alias: darwin pkg binaries.fd origin: user input target ~/.local/bring origin: index defaults target_config -- no value -- transform -- no value -- version 7.1.0 origin: user input
... ... ...
Result: - merged items into '/root/.local/bring': fd: file exists, not merged
Install details¶
In case you are wondering what the install command actually does, you can use the --explain flag to get some information about the variables used, and the steps that are executed during the install process (without actually doing anything):
> bring install --explain binaries.fd --os darwin Task: installing package 'fd' Variables arch x86_64 origin: index defaults os apple-darwin origin: user input, from alias: darwin pkg binaries.fd origin: user input target ~/.local/bring origin: index defaults target_config -- no value -- transform -- no value -- version 8.1.1 origin: package defaults, from alias: latest Steps - installing pkg 'fd' - gathering file(s) for package 'fd' - downloading file: https://github.com/sharkdp/fd/releases/download/v8.1.1/fd-v8.1.1-x86_64-apple-darwin.tar.gz - extracting archive (disregarding root folder, only using contents of it) - validating package content - merging files into folder '~/.local/bring'