From fcf16a163a5b3d328021f6195cdb205d8f470175 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Mon, 21 Oct 2019 11:59:59 +0200 Subject: [PATCH] docs: install: apt snippet: idempotent, bash compat, multiarch compat Co-authored-by: Janis Streib Co-authored-by: Christian Schwarz --- docs/installation.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index a1fd97c..b2f30e6 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -62,12 +62,12 @@ The fingerprint of the signing key for Debian / Ubuntu packages is ``E101 418F D It is available at ``https://zrepl.cschwarz.com/apt/apt-key.asc``. :: - - CODENAME="$(lsb_release -i -s | tr '[:upper:]' '[:lower:]') $(lsb_release -c -s | tr '[:upper:]' '[:lower:]')" - echo -n "Please confirm Distro and Codename by pressing ENTER: $CODENAME" - read -n _unused_ - curl https://zrepl.cschwarz.com/apt/apt-key.asc | apt-key add - - echo "deb https://zrepl.cschwarz.com/apt/$CODENAME main" >> /etc/apt/sources.list + apt update && apt install curl gnupg lsb-release; \ + ARCH="$(dpkg --print-architecture)"; \ + CODENAME="$(lsb_release -i -s | tr '[:upper:]' '[:lower:]') $(lsb_release -c -s | tr '[:upper:]' '[:lower:]')"; \ + echo "Using Distro and Codename: $CODENAME"; \ + (curl https://zrepl.cschwarz.com/apt/apt-key.asc | apt-key add -) && \ + (echo "deb [arch=$ARCH] https://zrepl.cschwarz.com/apt/$CODENAME main" > /etc/apt/sources.list.d/zrepl.list) && \ apt update Note that until zrepl reaches 1.0, all APT repositories will be updated to the latest zrepl release immediately.