how can I update R to version 4 on ubuntu

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.listthen I added this line: deb focal/ thensudo apt-get update and sudo apt-get install r-basebut it doesnt work. Somebody help me?

1

1 Answer

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 bionic-cran40/ Packages 4.1.0-1.1804.0 500 500 bionic-cran40/ Packages 4.0.5-1.1804.0 500 500 bionic-cran40/ Packages 4.0.4-1.1804.0 500 500 bionic-cran40/ Packages 4.0.4-1build1 500 500 hirsute/universe amd64 Packages 4.0.3-1.1804.0 500 500 bionic-cran40/ Packages 4.0.2-1.1804.0 500 500 bionic-cran40/ Packages 4.0.1-1.1804.0 500 500 bionic-cran40/ Packages 4.0.0-1.1804.0 500 500 bionic-cran40/ Packages 3.4.4-1ubuntu1 500 500 bionic/universe amd64 Packages

Instruction below taken from R installation guide.

wget -qO- | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
sudo add-apt-repository "deb $(lsb_release -cs)-cran40/"
sudo apt update
sudo apt install --no-install-recommends r-base

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like