Is R 4.2.2 available for installation on Ubuntu 22.04 LT?

R 4.2.2 for Ubuntu 22.04 LT systems seems not to be available by the usual routes. I have just discovered R2u for installing compiled debian packages. Can one also obtain a safe version of R 4.2.2 by using this repositorY?

Larry Hunsicker

I installed 4.2.2 on an Ubuntu 22.04 system. As suggested here:
https://cloud.r-project.org/bin/linux/ubuntu/fullREADME.html

I modified /etc/apt/sources.list to list the R repository and a backports repository.

~/R$ cat /etc/apt/sources.list                                                                             
deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/                                                          
deb https://lug.mines.edu/mirrors/ubuntu/ focal-backports main restricted universe 

I then did the usual
EDIT: I had to add the security key also before running apt-get. The instructions are at the link above.

sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev
3 Likes

This is more convenient than building from source. The default repo lags R releases quite a bit.

Thanks, FJCC. This all worked, and I am now running R 4.2.2.
Larry

You also can get [R 4.2.2 from RStudio](cf. Posit - Install R - Posit Documentation) as well

export R_VERSION=4.2.2
curl -O https://cdn.rstudio.com/r/ubuntu-2204/pkgs/r-${R_VERSION}_1_amd64.deb
sudo gdebi r-${R_VERSION}_1_amd64.deb

One of the benefits of this R installation is that you can install multiple R versions at the same time without any problem, avoid adding additional repositories to your apt setup (which could break things further down the road) and so on. For more information, see here.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.