Keep Installing Outdated Version of R

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
kindoflame
Level 1
Level 1
Posts: 23
Joined: Tue Mar 30, 2021 10:14 am

Keep Installing Outdated Version of R

Post by kindoflame »

I have been trying forever to get R installed and nothing works. I went to CRAN (https://mirrors.nics.utk.edu/cran/) and followed all of the instructions, but it installed R 3.6.3! This would not be a problem, except every library has updated to R 4.0 and nothing from 3.5 can be used with 4.0, and vice versa. I can use base R just fine in RStudio, but any attempts to downloads libraries fail. I have tried everything I could possible think of and am completely out of ideas.

What I have tried:
- Installing R 4.0 from CRAN
- Searching the Software Manager
- Installing R 3.5 and upgrading to 4.0
- Searching for and using old libraries
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
spamegg
Level 13
Level 13
Posts: 4782
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Keep Installing Outdated Version of R

Post by spamegg »

I went to
https://cran.rstudio.com/
clicked on "Download R for Linux"
then clicked on "Ubuntu"
It says:

Code: Select all

Package for the current R 4.0. release* are available for most stable Desktop releases of Ubuntu until their official end of life date. However, only the latest Long Term Support (LTS) release is fully supported. As of November 1, 2020 the supported releases are

    Groovy Gorilla (20.10, amd64 only),
    Focal Fossa (20.04; LTS and amd64 only),
    Bionic Beaver (18.04; LTS), and
    Xenial Xerus (16.04; LTS).

Run these lines (as root or by prefixing sudo) to tell Ubuntu about the R binaries at CRAN.

# update indices
apt update -qq
# install two helper packages we need
apt install --no-install-recommends software-properties-common dirmngr
# import the signing key (by Michael Rutter) for these repo
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

Here we use lsb_release -cs to access which Ubuntu flavor you run: one of “groovy”, “focal”, “bionic”, …

Then run

apt install --no-install-recommends r-base

to to install R and its dependencies.
User avatar
spamegg
Level 13
Level 13
Posts: 4782
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Keep Installing Outdated Version of R

Post by spamegg »

You are correct, this installs 3.6.3. So I think you need to contact CRAN and tell them there is a problem with their installation instructions.
Moonstone Man
Level 16
Level 16
Posts: 6078
Joined: Mon Aug 27, 2012 10:17 pm

Re: Keep Installing Outdated Version of R

Post by Moonstone Man »

kindoflame wrote: Mon Apr 12, 2021 3:06 am I went to CRAN (https://mirrors.nics.utk.edu/cran/) and followed all of the instructions, but it installed R 3.6.3!
There's no need to contact CRAN for anything just yet.

Those instructions will always install the version in the current Ubuntu Focal repositories because there's a simple step missing. After add-apt-repository..., just sudo apt update.

Now you can contact them and also tell them why it's wrong. They are probably using an Ubuntu-based distro that doesn't require sudo apt update, unlike Linux Mint.
kindoflame
Level 1
Level 1
Posts: 23
Joined: Tue Mar 30, 2021 10:14 am

Re: Keep Installing Outdated Version of R

Post by kindoflame »

I did the installation instructions again, adding

Code: Select all

sudo apt update
where you said. I got an error and I'm not sure what it means.

Code: Select all

Err:11 https://cloud.r-project.org/bin/linux/ubuntu ulyana-cran40/ Release
  404  Not Found [IP: 13.249.183.54 443]
Reading package lists... Done
E: The repository 'https://cloud.r-project.org/bin/linux/ubuntu ulyana-cran40/ Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
From what I can tell, you get this error when you are using a new version of your OS and the repository has not updated yet. Mint 20.1 has been out for a few months now, so it seems unlikely to me that CRAN has not updated their release files. Plus, if the problem was out-dated release files, then how could I install any version of R. I feel like something else must be going on, but I am not sure what.
Reddog1
Level 7
Level 7
Posts: 1865
Joined: Wed Jun 01, 2011 2:12 pm

Re: Keep Installing Outdated Version of R

Post by Reddog1 »

apt-get update --allow-insecure-repositories

At least, that used to be the command. Whether you do that or not is up to you.
kindoflame
Level 1
Level 1
Posts: 23
Joined: Tue Mar 30, 2021 10:14 am

Re: Keep Installing Outdated Version of R

Post by kindoflame »

I got a bunch of things like:

Code: Select all

Ign:1 http://packages.linuxmint.com ulyssa InRelease
Ign:2 https://cloud.r-project.org/bin/linux/ubuntu ulyssa-cran40/ InRelease
Hit:3 http://packages.linuxmint.com ulyssa Release
One of them gave an error though:

Code: Select all

Err:5 https://cloud.r-project.org/bin/linux/ubuntu ulyssa-cran40/ Packages
  404  Not Found [IP: 13.249.183.20 443]
kindoflame
Level 1
Level 1
Posts: 23
Joined: Tue Mar 30, 2021 10:14 am

Re: Keep Installing Outdated Version of R

Post by kindoflame »

So its been over a week and no one has any new advice. Is this is point where I should try contacting CRAN? I really don't want to since they are probably really busy, but I can't think of anything else to do.
mikeflan
Level 16
Level 16
Posts: 6912
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Keep Installing Outdated Version of R

Post by mikeflan »

Yeah, I would contact them.
I don't see anything great in this post, but maybe you will:
viewtopic.php?f=47&t=334158
kindoflame
Level 1
Level 1
Posts: 23
Joined: Tue Mar 30, 2021 10:14 am

Re: Keep Installing Outdated Version of R

Post by kindoflame »

I followed some of the linked provided in that thread and eventually got here: https://cloud.r-project.org/bin/linux/u ... EADME.html. The bottom of the page says,
The best place to report problems with these packages or ask R questions specific to Ubuntu is the R-SIG-Debian mailing list. See

https://stat.ethz.ch/mailman/listinfo/r-sig-debian

for more information.
I am not too hopeful that anyone still uses that mailing list, but if someone does they will probably be an expert with decades of experience. I'll send an email describing my problem and if I don't get a reply back in a few days I'll message the webmaster for CRAN.
Wakatakakage
Level 3
Level 3
Posts: 149
Joined: Wed Apr 21, 2021 10:34 pm

Re: Keep Installing Outdated Version of R

Post by Wakatakakage »

I would assume that R's Ubuntu package installer only supports Ubuntu version codenames, not Linux Mint codenames.

So you may want to try replacing $(lsb_release -cs) with focal in the repository listing. The shell turns $(lsb_release -cs) into ulyana in Linux Mint 20, as shown in your results. It may be better to explicitly specify the version that you want:

add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/"
User avatar
spamegg
Level 13
Level 13
Posts: 4782
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Keep Installing Outdated Version of R

Post by spamegg »

@kindoflame

Go to Update Manager, Software Sources, Additional Repositories.
Click "Add".
Paste this and click OK:

Code: Select all

deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/
Then sudo apt update and sudo apt install r-base
That should do it!
version4.png
mikeflan
Level 16
Level 16
Posts: 6912
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Keep Installing Outdated Version of R

Post by mikeflan »

Way to go. You did good spamegg :)
kindoflame
Level 1
Level 1
Posts: 23
Joined: Tue Mar 30, 2021 10:14 am

Re: Keep Installing Outdated Version of R

Post by kindoflame »

spamegg, if you ever need a kidney, I've got one for you.
User avatar
spamegg
Level 13
Level 13
Posts: 4782
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Keep Installing Outdated Version of R

Post by spamegg »

kindoflame wrote: Wed Apr 28, 2021 11:20 am spamegg, if you ever need a kidney, I've got one for you.
:mrgreen:

Mark your topic title as [SOLVED], thank you!
Locked

Return to “Software & Applications”