v5

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-167122208.0 KB
install

install script

Return a self-contained bash setup script for the given package manager, served as Content-Type: application/x-sh. Pipe it to a shell — sudo bash for the OS package managers (they write to system paths), plain bash for the language ones — e.g.

curl -s https://<master-token>:@packagecloud.io/install/repositories/{user_id}/{repo}/script.deb.sh | sudo bash

By type:

  • deb: detect the OS, install prerequisites (curl, gpg, apt-transport-https, debian-archive-keyring), import the repo GPG key (via gpg_key_url.list), write /etc/apt/sources.list.d/ from config_file.list, then apt-get update.
  • rpm: write a .repo from config_file.repo into /etc/yum.repos.d/ (or /etc/zypp/repos.d/ on SUSE) and refresh the cache.
  • alpine: import the repo's RSA signing key (via rsa_key_url.alpine) into /etc/apk/keys, then append the apk repository (from config_file.alpine) to /etc/apk/repositories.
  • node: mint a read token (via tokens.text) and write an .npmrc registry entry.
  • gem: mint a read token and gem source --add the repo.
  • python: mint a read token and add the repo to ~/.pip/pip.conf.
  • helm: mint a read token and helm repo add (then helm repo update) with the token as the username.

The deb, rpm, alpine, and helm scripts register the repository locally as <user>_<repo> — only the / separator becomes _; dashes and other characters in the repo name are preserved (e.g. acme/my-repoacme_my-repo). That name is used for the apt .list file (and its -archive-keyring.gpg), the yum/zypper .repo file, the apk repository entry, and the helm repo add name respectively. The node, gem, and python scripts create no named entry — they configure the registry/source URL directly.

Inputs are read from environment variables set before running (the script takes no arguments when piped):

  • os, dist: override the auto-detected distribution and version — honored by deb, rpm, and alpine (see the supported OS list at https://packagecloud.io/docs#os_distro_version).
  • unique_id: the read-token name to create/reuse — honored by deb, rpm, node, python, and alpine; defaults to the machine's hostname. (gem and helm always use the hostname.)
get/install/repositories/{user_id}/{repo}/script.{type}.sh

Path parameters

user_idstring required

The username the repository belongs to.

repostring required

The name of the repository.

typestring required

Package-manager type. Known values: deb, rpm, alpine, node, gem, python, helm.

Response

A bash setup script.