
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Setup apt packages and repositories in Debian/Ubuntu-based distributions
npm install --save setup-apt
updateAptAlternatives (function)Update the alternatives for a package
Parameters:
string) - The name of the packagestring) - The path to the binarynumber) - The priority of the alternative (Defaults to 40)returns: Promise
addUpdateAlternativesToRc (function)Add the update-alternatives command to the rc file
Parameters:
string) - The name of the packagestring) - The path to the binaryRcOptions) - The options for the rc file to add the update-alternatives command tonumber) - The priority of the alternative (Defaults to 40)returns: Promise
getAptEnv (function)Get the environment variables to use for the apt command
Parameters:
string) - The apt command to usereturns: ProcessEnv
aptTimeout (variable)The timeout to use for apt commands Wait up to 300 seconds if the apt-get lock is held
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
isAptPackInstalled (function)Check if a package is installed
Parameters:
string) - The package to checkreturns: Promise
isAptPackRegexInstalled (function)Check if a package matching a regexp is installed
Parameters:
string) - The regexp to checkreturns: Promise
updatedRepos (variable)updateAptRepos (function)Update the apt repositories
Parameters:
string) - The apt command to use (optional)returns: void
updateAptReposMemoized (variable)Update the apt repositories (memoized)
Parameters:
filterAndQualifyAptPackages (function)Filter out the packages that are already installed and qualify the packages into a full package name/version
Parameters:
AptPackage[])string)returns: Promise<string[]>
qualifiedNeededAptPackage (function)Qualify the package into full package name/version. If the package is not installed, return the full package name/version. If the package is already installed, return undefined
Parameters:
AptPackage)string)returns: Promise
initApt (function)Install gnupg and certificates (usually missing from docker containers)
Parameters:
string)returns: Promise
initAptMemoized (variable)Install gnupg and certificates (usually missing from docker containers) (memoized)
addAptRepository (function)Parameters:
string)string)returns: Promise
installAddAptRepo (function)Parameters:
string)returns: Promise
InstallationInfo (type)The information about an installation result
AptPackage (type)The information about an apt package
installAptPack (function)Install a package using apt
Parameters:
AptPackage[]) - The packages to install (name, and optional info like version and repositories)boolean) - Whether to update the package list before installing (Defaults to false)returns: Promise
await installAptPack([{ name: "ca-certificates" }, { name: "gnupg" }])
await installAptPack([
{
name: "gcc",
version,
repository: "ppa:ubuntu-toolchain-r/test",
key: { key: "1E9377A2BA9EF27F", fileName: "ubuntu-toolchain-r-test.gpg" },
},
])
AddAptKeyOptions (type)addAptKey (function)Add an apt key
Parameters:
AddAptKeyOptions) - The options for adding the keyreturns: Promise
await addAptKey({ key: "3B4FE6ACC0B21F32" fileName: "bazel-archive-keyring.gpg"})
await addAptKey({
keyUrl: "https://bazel.build/bazel-release.pub.gpg",
fileName: "bazel-archive-keyring.gpg",
})
defaultKeyStorePath (variable)KeyServerOptions (type)defaultKeyServer (variable)addAptKeyViaServer (function)Add an apt key via a keyserver
Parameters:
KeyServerOptions)returns: Promise
KeyUrl (type)addAptKeyViaURL (function)Add an apt key via a download
Parameters:
KeyUrl)returns: Promise
You can sponsor my work here:
https://github.com/sponsors/aminya
Pull requests, issues and feature requests are welcome. See the Contributing guide.
FAQs
Setup apt packages and repositories in Debian/Ubuntu-based distributions
We found that setup-apt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.