setup-cpp/packages/setup-apt
Amin Yahyaabadi e881f4079c
chore: add prepublishOnly for packages
2024-08-16 02:32:26 -07:00
..
src refactor: refactor and add docs for setup-apt functions 2024-08-16 02:19:59 -07:00
.eslintrc.json feat: add setup-apt package for all the apt utils 2024-08-16 01:50:32 -07:00
README.md refactor: refactor and add docs for setup-apt functions 2024-08-16 02:19:59 -07:00
package.json chore: add prepublishOnly for packages 2024-08-16 02:32:26 -07:00
tsconfig.json feat: add setup-apt package for all the apt utils 2024-08-16 01:50:32 -07:00

README.md

setup-apt

Version License: Apache--2.0

Setup apt packages and repositories in Debian/Ubuntu-based distributions

Install

npm install --save setup-apt

Usage

updateAptAlternatives (function)

Update the alternatives for a package

Parameters:

  • name (string) - The name of the package
  • path (string) - The path to the binary
  • priority (number) - The priority of the alternative (Defaults to 40)

returns: Promise

addUpdateAlternativesToRc (function)

Add the update-alternatives command to the rc file

Parameters:

  • name (string) - The name of the package
  • path (string) - The path to the binary
  • rcOptions (RcOptions) - The options for the rc file to add the update-alternatives command to
  • priority (number) - The priority of the alternative (Defaults to 40)

returns: Promise

isAptPackInstalled (function)

Check if a package is installed

Parameters:

  • pack (string) - The package to check

returns: Promise

isAptPackRegexInstalled (function)

Check if a package matching a regexp is installed

Parameters:

  • regexp (string) - The regexp to check

returns: Promise

updateRepos (function)

Update the apt repositories

Parameters:

  • apt (string) - The apt command to use (optional)

returns: void

InstallationInfo (type)

The information about an installation result

aptTimeout (variable)

The timeout to use for apt commands Wait up to 300 seconds if the apt-get lock is held

AptPackage (type)

The information about an apt package

installAptPack (function)

Install a package using apt

Parameters:

  • packages (AptPackage[]) - The packages to install (name, and optional info like version and repositories)
  • update (boolean) - Whether to update the package list before installing (Defaults to false)

returns: Promise

hasNala (function)

Check if nala is installed

returns: boolean

getApt (function)

Get the apt command to use If nala is installed, use that, otherwise use apt-get

returns: string

getEnv (function)

Get the environment variables to use for the apt command

Parameters:

  • apt (string) - The apt command to use

returns: ProcessEnv

addAptKeyViaServer (function)

Add an apt key via a keyserver

Parameters:

  • keys (string[]) - The keys to add
  • name (string) - The name of the key
  • server (string) - The keyserver to use (Defaults to keyserver.ubuntu.com)

returns: Promise

addAptKeyViaDownload (function)

Add an apt key via a download

Parameters:

  • name (string) - The name of the key
  • url (string) - The URL of the key

returns: Promise

🤝 Contributing

You can sponsor my work here:

https://github.com/sponsors/aminya

Pull requests, issues and feature requests are welcome. See the Contributing guide.