Resolve Machine Runner 3 on Linux Install Intermittent Fail due to Packagecloud.io Script
Colin
The Linux install docs (https://circleci.com/docs/install-machine-runner-3-on-linux/) add the apt repo by piping packagecloud's install script into bash:
curl -sf "https://packagecloud.io/install/repositories/circleci/runner/script.deb.sh?any=true" | bash
The packagecloud script runs apt-get update / apt-get install without a dpkg lock timeout, so Ubuntu boot apt-daily / unattended-upgrades may hold the lock and the install will fail intermittently. A curl failure is also silent under | bash, so the repo is never added and the later apt-get install circleci-runner fails.
I would like to request that CircleCI:
- Work with packagecloud.io to make the script retry on dpkg lock contention (e.g. -o DPkg::lock::Timeout=300).
- Document adding the repo directly as a workaround:
curl -fsSL https://packagecloud.io/circleci/runner/gpgkey | gpg --dearmor -o /usr/share/keyrings/circleci-runner-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/circleci-runner-archive-keyring.gpg] https://packagecloud.io/circleci/runner/any/ any main" > /etc/apt/sources.list.d/circleci_runner.list
apt-get update && apt-get install circleci-runner