Skip to content

Commit

Permalink
README: use which sudo
Browse files Browse the repository at this point in the history
So it works with and without sudo installed.
(If not installed we assume the root user.)
  • Loading branch information
gaborcsardi committed Sep 2, 2023
1 parent c0f8505 commit da69a36
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -194,19 +194,19 @@ We use the R builds from the Posit
On any Ubuntu or Debian distro, you can use our package repository to
install rig. First you add our key to your config:
```
sudo curl -L https://rig.r-pkg.org/deb/rig.gpg -o /etc/apt/trusted.gpg.d/rig.gpg
`which sudo` curl -L https://rig.r-pkg.org/deb/rig.gpg -o /etc/apt/trusted.gpg.d/rig.gpg
```

Then add the rig repository:
```
echo "deb http://rig.r-pkg.org/deb rig main" > /etc/apt/sources.list.d/rig.list
`which sudo` echo "deb http://rig.r-pkg.org/deb rig main" > /etc/apt/sources.list.d/rig.list
```

If you already added both the key and the repository, then install the `r-rig`
package (`rig` is a different package in Debian and Ubuntu):
```
sudo apt update
sudo apt install r-rig
`which sudo` apt update
`which sudo` apt install r-rig
```

#### Installing rig on RHEL, Fedora, CentOS, Rocky Linux, Almalinux, etc. (RPM package) <a id="id-rhel-fedora-centos-rocky-linux-almalinux-etc-rpm-package">
Expand All @@ -215,15 +215,15 @@ On most RPM based distros (except for OpenSUSE and SLES) you can install
our RPM package directly:

```
yum install -y https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.$(arch).rpm
`which sudo` yum install -y https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.$(arch).rpm
```

#### Installing rig on OpenSUSE and SLES (RPM package) <a id="id-opensuse-and-sles-rpm-package">

On OpenSUSE and SLES use `zypper` instead of `yum`:

```
zypper install -y --allow-unsigned-rpm https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.$(arch).rpm
`which sudo` zypper install -y --allow-unsigned-rpm https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.$(arch).rpm
```

#### Installing rig on any Linux distribution (tarball) <a id="id-linux-targz">
Expand All @@ -233,7 +233,7 @@ and uncompress it to `/usr/local`

```
curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-$(arch)-latest.tar.gz |
sudo tar xz -C /usr/local
`which sudo` tar xz -C /usr/local
```

### Installing auto-complete on macOS and Linux <a id="id-auto-complete">
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,38 +191,38 @@ project](https://github.com/rstudio/r-builds#r-builds).
On any Ubuntu or Debian distro, you can use our package repository to
install rig. First you add our key to your config:

sudo curl -L https://rig.r-pkg.org/deb/rig.gpg -o /etc/apt/trusted.gpg.d/rig.gpg
`which sudo` curl -L https://rig.r-pkg.org/deb/rig.gpg -o /etc/apt/trusted.gpg.d/rig.gpg

Then add the rig repository:

echo "deb http://rig.r-pkg.org/deb rig main" > /etc/apt/sources.list.d/rig.list
`which sudo` echo "deb http://rig.r-pkg.org/deb rig main" > /etc/apt/sources.list.d/rig.list

If you already added both the key and the repository, then install the
`r-rig` package (`rig` is a different package in Debian and Ubuntu):

sudo apt update
sudo apt install r-rig
`which sudo` apt update
`which sudo` apt install r-rig

#### Installing rig on RHEL, Fedora, CentOS, Rocky Linux, Almalinux, etc. (RPM package) <a id="id-rhel-fedora-centos-rocky-linux-almalinux-etc-rpm-package">

On most RPM based distros (except for OpenSUSE and SLES) you can install
our RPM package directly:

yum install -y https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.$(arch).rpm
`which sudo` yum install -y https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.$(arch).rpm

#### Installing rig on OpenSUSE and SLES (RPM package) <a id="id-opensuse-and-sles-rpm-package">

On OpenSUSE and SLES use `zypper` instead of `yum`:

zypper install -y --allow-unsigned-rpm https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.$(arch).rpm
`which sudo` zypper install -y --allow-unsigned-rpm https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.$(arch).rpm

#### Installing rig on any Linux distribution (tarball) <a id="id-linux-targz">

Download the latest releast from <https://github.com/r-lib/rig/releases>
and uncompress it to `/usr/local`

curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-$(arch)-latest.tar.gz |
sudo tar xz -C /usr/local
`which sudo` tar xz -C /usr/local

### Installing auto-complete on macOS and Linux <a id="id-auto-complete">

Expand Down

0 comments on commit da69a36

Please sign in to comment.