From 50e8ee45490cf085e790a97a72c05c8b9660154f Mon Sep 17 00:00:00 2001 From: sre Date: Wed, 7 Apr 2021 10:33:18 +0200 Subject: [PATCH] docs: apt repo: use sudo in the snippet that sets up the repo I generally like when snippets are provided in a way which could be used without running as root, and uses sudo when applicable. This change allows for this. It will, however print out one extra line, which is possible to remove by adding '>/dev/null' after '/etc/apt/sources.list.d/zrepl.list'. closes #461 --- docs/installation/apt-repos.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/installation/apt-repos.rst b/docs/installation/apt-repos.rst index 98c0ba2..e8734b2 100644 --- a/docs/installation/apt-repos.rst +++ b/docs/installation/apt-repos.rst @@ -13,13 +13,13 @@ The following snippet configure the repository for your Debian or Ubuntu release :: - apt update && apt install curl gnupg lsb-release; \ + sudo apt update && sudo 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 + (curl https://zrepl.cschwarz.com/apt/apt-key.asc | sudo apt-key add -) && \ + (echo "deb [arch=$ARCH] https://zrepl.cschwarz.com/apt/$CODENAME main" | sudo tee /etc/apt/sources.list.d/zrepl.list) && \ + sudo apt update .. NOTE::