Score:0

how can I update R to version 4 on ubuntu

cn flag

I'm using Ubuntu 20.04.3 LTS. I'm using R version 3.6.3. Some packages is not in there. Therefore I need R version 4. or higher than 4. I tried those things: sudo -H gedit /etc/apt/sources.list then I added this line: deb http://cran.rstudio.com/bin/linux/ubuntu focal/ then sudo apt-get update and sudo apt-get install r-base but it doesnt work. Somebody help me?

Liso avatar
sd flag
Doesn't work as what?
Score:2
sd flag

The R guide to install on Ubuntu has already covered this, I tried the command and it seems to give R 4.0. Result of apt-cache policy.

$ apt-cache policy r-base
r-base:
  Installed: (none)
  Candidate: 4.1.1-1.1804.0
  Version table:
     4.1.1-1.1804.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.1.0-1.1804.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.5-1.1804.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.4-1.1804.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.4-1build1 500
        500 https://mirror.gi.co.id/ubuntu hirsute/universe amd64 Packages
     4.0.3-1.1804.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.2-1.1804.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.1-1.1804.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     4.0.0-1.1804.0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     3.4.4-1ubuntu1 500
        500 https://mirror.gi.co.id/ubuntu bionic/universe amd64 Packages

Instruction below taken from R installation guide.

wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
sudo apt update
sudo apt install --no-install-recommends r-base
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.