0

I am trying to update to R version 3.5.3, by using the R manual. However, when I type this line:

deb https://cloud.r-project.org/bin/linux/ubuntu cosmic-cran35/

I get a return of command not found.

I tried to add it to my source list as previously suggested, but this does not seem to work. I am trying to do this on a linux system

  • 1
    deb is not a command, check out [here](https://askubuntu.com/questions/233064/why-am-i-getting-command-deb-not-found/233069) – mischva11 Apr 12 '19 at 12:18
  • also for installing R on ubuntu [here](https://askubuntu.com/questions/1031597/r-3-5-0-for-ubuntu) – mischva11 Apr 12 '19 at 12:21
  • The second post about installing is now out of date – Phil Apr 12 '19 at 12:24
  • 1
    Just _read_ the appropriate [README](https://cloud.r-project.org/bin/linux/ubuntu/README.html) at the source repository and its mirror -- it has all instructions and detail! – Dirk Eddelbuettel Apr 12 '19 at 12:34
  • @DirkEddelbuettel the README is a great resource but it does skip over *how* to add the appropriate `deb` to your `/etc/apt/sources.list` which is seemingly what the OP was struggling with. – Phil Apr 12 '19 at 17:07

1 Answers1

2

Edit: Thanks @Ralf for correction (see comments)

Append the 'deb' line to your sources.list by opening a terminal and typing:

echo "deb https://cloud.r-project.org/bin/linux/ubuntu cosmic-cran35/" | sudo tee -a /etc/apt/sources.list

Install the R-CRAN GPG key to verify what you're installing:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

Update your package list and install with:

sudo apt update
sudo apt install r-base r-base-dev
Phil
  • 4,344
  • 2
  • 23
  • 33