Skip to content

linux Submodule

Structs

LinuxInstallPackageProps

Initializer

1
2
3
import { linux } from '@gcix/gcix'

const linuxInstallPackageProps: linux.LinuxInstallPackageProps = { ... }

Properties

Name Type Description
packages string[] A string listing all the packages to be installed, separated by spaces.
sudo boolean Specifies whether the command(s) should be executed with sudo.

packagesRequired
public readonly packages: string[];
  • Type: string[]

A string listing all the packages to be installed, separated by spaces.


sudoOptional
public readonly sudo: boolean;
  • Type: boolean
  • Default: false

Specifies whether the command(s) should be executed with sudo.


Classes

LinuxScripts

Static Functions

Name Description
installPackages Returns a shell command to check and install a Linux package using the available package manager.

installPackages
1
2
3
import { linux } from '@gcix/gcix'

linux.LinuxScripts.installPackages(props: LinuxInstallPackageProps)

Returns a shell command to check and install a Linux package using the available package manager.

This function is useful for installing packages within a GitLab job when the system's package manager is uncertain. Currently supported package managers are: apk, apt-get, yum, dnf, and zypper.

Keep in mind that this function supports installing only one package name. If different package managers have different names for the same package, this script might fail.

Source: https://unix.stackexchange.com/a/571192/139685

propsRequired