Skip to content

linux Submodule

Structs

LinuxInstallPackageProps

Initializer

1
2
3
4
5
6
from gcix import linux

linux.LinuxInstallPackageProps(
  packages: typing.List[str],
  sudo: bool = None
)

Properties

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

packagesRequired
packages: typing.List[str]
  • Type: typing.List[str]

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


sudoOptional
sudo: bool
  • Type: bool
  • Default: false

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


Classes

LinuxScripts

Static Functions

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

install_packages
1
2
3
4
5
6
from gcix import linux

linux.LinuxScripts.install_packages(
  packages: typing.List[str],
  sudo: bool = None
)

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

packagesRequired
  • Type: typing.List[str]

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


sudoOptional
  • Type: bool
  • Default: false

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