Installing latest version of R on LMDE 3

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
Marsik
Level 1
Level 1
Posts: 5
Joined: Sat Jan 23, 2021 12:52 pm

Installing latest version of R on LMDE 3

Post by Marsik »

I am new to Linux (close to no experience) and need to install the latest version of R for my work. Following the installation guidelines from cran (see: http://cran.rstudio.com/bin/linux/debian/), I seem to succeed in executing the initial commands required for installation. However, although the output claims that the latest version has been installed, to my knowledge it is not the latest version, which should be > 4.0, see: https://packages.debian.org/sid/r-base. Based on some research, I seem to be stuck on either properly generating an .asc file or to 'add' this file to the 'apt'. This is the problem in a nutshell!

I am providing further details of the various steps I took in the following and, where possible, adding sources to show where I obtained this information. At first I tried the recommended steps from the cran website:

Code: Select all

apt-get update
apt-get install r-base r-base-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
r-base is already the newest version (3.3.3-1).
r-base-dev is already the newest version (3.3.3-1).
0 upgraded, 0 newly installed, 0 to remove and 255 not upgraded.
This does download R, but not the latest version, which is my problem. I found some posts addressing exactly this issue, e.g.

viewtopic.php?t=195496

Taking a proposed solution from this thread by menuhin for LMDE 1, the first command does not generate any output for me, perhaps indicating that it worked (not sure)?

Code: Select all

sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/debian wheezy-cran3/" >> /etc/apt/sources.list'

The second command does not work, however, see:

Code: Select all

sudo apt-key adv --keyserver keys.gnupg.net --recv-key 381BA480
Executing: /tmp/apt-key-gpghome.QOnT2lF75h/gpg.1.sh --keyserver keys.gnupg.net --recv-key 381BA480
gpg: keyserver receive failed: Server indicated a failure
Adapting the key fingerprint to the one proposed in the Secure apt section at the R installation guidelines (http://cran.rstudio.com/bin/linux/debian/, i.e., 'E19F5F87128899B192B1A2C2AD5F960A256A04AF') also yields the same error message. The solution from the R installation guidelines is to generate a new plain text file (.asc) with the key block that can be obtained at https://keyserver.ubuntu.com. I searched a bit on generating plain text files and the following command seemed to rename the .txt file I had generated for the key block (i.e. jranke.txt) into an .asc file (source: https://unix.stackexchange.com/question ... public-key):

Code: Select all

mv jranke.txt jranke.asc
However, the next command

Code: Select all

sudo apt-key add jranke.asc
would still result in an error message

Code: Select all

gpg: no valid OpenPGP data found.
Did I not generate the .asc file properly or can I not 'add' it via 'apt-key' in the way I did it? Or should I approach this in an entirely different way? I would be much obliged for any hints or solutions.

Following the user guidelines, I am including pertinent hard-/software specifications:

Code: Select all

inxi -Fxxxrz
System:
  Host: leo Kernel: 4.9.0-12-amd64 x86_64 bits: 64 compiler: gcc v: 6.3.0 
  Desktop: Cinnamon 4.2.4 wm: muffin 4.2.2 dm: LightDM 1.18.3 
  Distro: LMDE 3 Cindy base: Debian 9.3 stretch 
Machine:
  Type: Laptop System: LENOVO product: 80NT v: Lenovo ideapad 500-15ISK 
  serial: <filter> Chassis: type: 10 v: Lenovo ideapad 500-15ISK 
  serial: <filter> 
  Mobo: LENOVO model: Lenovo ideapad 5 v: SDK0J40709 WIN serial: <filter> 
  UEFI [Legacy]: LENOVO v: CFCN21WW(V1.03) date: 08/10/2015 
Battery:
  ID-1: BAT1 charge: 4.9 Wh condition: 20.3/28.5 Wh (71%) volts: 13.8/14.4 
  model: LENOVO PABAS0241231 type: Li-ion serial: <filter> 
  status: Discharging 
CPU:
  Topology: Dual Core model: Intel Core i7-6500U bits: 64 type: MT MCP 
  arch: Skylake rev: 3 L2 cache: 4096 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 20736 
  Speed: 500 MHz min/max: 400/3100 MHz Core speeds (MHz): 1: 500 2: 500 
  3: 500 4: 500 
Graphics:
  Device-1: Intel HD Graphics 520 vendor: Lenovo driver: i915 v: kernel 
  bus ID: 00:02.0 chip ID: 8086:1916 
  Device-2: AMD Topaz XT [Radeon R7 M260/M265 / M340/M360 / M440/M445] 
  vendor: Lenovo driver: amdgpu v: kernel bus ID: 01:00.0 chip ID: 1002:6900 
  Display: x11 server: X.Org 1.19.2 driver: amdgpu,ati,modesetting 
  unloaded: fbdev,radeon,vesa resolution: 1920x1080~60Hz 
  OpenGL: renderer: Mesa DRI Intel HD Graphics 520 (Skylake GT2) 
  v: 4.5 Mesa 13.0.6 compat-v: 3.0 direct render: Yes 
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Lenovo 
  driver: snd_hda_intel v: kernel bus ID: 00:1f.3 chip ID: 8086:9d70 
  Sound Server: ALSA v: k4.9.0-12-amd64 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Lenovo driver: r8169 v: 2.3LK-NAPI port: 3000 bus ID: 02:00.0 
  chip ID: 10ec:8168 
  IF: enp2s0 state: down mac: <filter> 
  Device-2: Intel Dual Band Wireless-AC 3165 Plus Bluetooth driver: iwlwifi 
  v: kernel port: 3000 bus ID: 03:00.0 chip ID: 8086:3166 
  IF: wlp3s0 state: up mac: <filter> 
Drives:
  Local Storage: total: 931.51 GiB used: 375.65 GiB (40.3%) 
  ID-1: /dev/sda vendor: Seagate model: ST1000LM024 HN-M101MBB 
  size: 931.51 GiB speed: 6.0 Gb/s rotation: 5400 rpm serial: <filter> 
  rev: 0001 scheme: MBR 
Partition:
  ID-1: / size: 93.36 GiB used: 10.01 GiB (10.7%) fs: ext4 dev: /dev/sda2 
  ID-2: /home size: 806.12 GiB used: 365.64 GiB (45.4%) fs: ext4 
  dev: /dev/sda3 
  ID-3: swap-1 size: 16.17 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda1 
Sensors:
  System Temperatures: cpu: 39.0 C mobo: N/A gpu: amdgpu temp: 37 C 
  Fan Speeds (RPM): N/A 
Repos:
  Active apt repos in: /etc/apt/sources.list 
  1: deb http://cran.rstudio.com/bin/linux/debian wheezy-cran3/
  Active apt repos in: /etc/apt/sources.list.d/mendeleydesktop.list 
  1: deb https://desktop-download.mendeley.com/download/apt stable main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
  1: deb http://packages.linuxmint.com cindy main upstream import backport #id:linuxmint_main
  2: deb https://deb.debian.org/debian stretch main contrib non-free
  3: deb https://deb.debian.org/debian stretch-updates main contrib non-free
  4: deb http://security.debian.org stretch/updates main contrib non-free
  5: deb http://www.deb-multimedia.org stretch main non-free
  Active apt repos in: /etc/apt/sources.list.d/skype-stable.list 
  1: deb [arch=amd64] https://repo.skype.com/deb stable main
  Active apt repos in: /etc/apt/sources.list.d/teamviewer.list 
  1: deb https://linux.teamviewer.com/deb stable main
Info:
  Processes: 257 Uptime: 44d 1h 45m Memory: 15.54 GiB used: 7.29 GiB (46.9%) 
  Init: systemd v: 232 runlevel: 5 Compilers: gcc: 6.3.0 alt: 6 Shell: bash 
  v: 4.4.12 running in: gnome-terminal inxi: 3.0.32
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
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: Installing latest version of R on LMDE 3

Post by JoeFootball »

Marsik wrote: Distro: LMDE 3 Cindy base: Debian 9.3 stretch
Aside from R, I wanted to note that support for LMDE 3 ended July 1st 2020, and therefore has not received security updates since.

Edit: Added EOL date.
Last edited by JoeFootball on Wed Jan 27, 2021 8:21 am, edited 1 time in total.
Marsik
Level 1
Level 1
Posts: 5
Joined: Sat Jan 23, 2021 12:52 pm

Re: Installing latest version of R on LMDE 3

Post by Marsik »

Thanks for the pointer, does that mean a response (solution) to my query here is unlikely?
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: Installing latest version of R on LMDE 3

Post by JoeFootball »

Marsik wrote: ... does that mean a response (solution) to my query here is unlikely?
No, that's not what I was attempting to imply, though to be clear, I'd say using any OS which is no longer receiving security updates to be a risky proposition, especially if it's connecting to the internet and/or otherwise networked.

That said, specific to installing R from the Sid repository, I'm not sure you'd find many people advising you to mix Unstable packages with Debian 9 packages. Regardless, if this is an endeavor you'd still like to pursue, I'd suggest downloading the .deb archive from Sid, and attempt a manual install. This will likely involve chasing down dependencies, but it's a safer route.
Marsik
Level 1
Level 1
Posts: 5
Joined: Sat Jan 23, 2021 12:52 pm

Re: Installing latest version of R on LMDE 3

Post by Marsik »

Thanks for the explanation. I agree with you in that it would be better to upgrade. I did, however, not install the OS myself and am worried that I may run into problems when upgrading to the latest version. My main goal with the current OS is to learn, and "play around" with, Linux, and in that respect the current version may serve that purpose. But, if possible, I'd like to familiarize myself a bit more with the current OS before doing something more "major" like upgrading the entire system.

I gave it a go with the current version of R that I managed to install, but, as pointed out on various blogs, I quickly ran into problems in that many packages need newer versions of R. So yes, it looks like I need to install the latest version of R (> 3.3) in order to have the full functionality of R and access to various packages on my system. In principle, I am not stuck to any one way to get to this goal (latest version). If you don't mind, could you guide me a bit on how to do what you suggest on the terminal?
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: Installing latest version of R on LMDE 3

Post by JoeFootball »

Marsik wrote: If you don't mind, could you guide me a bit on how to do what you suggest on the terminal?
Again, to be clear, this would not be what I'd recommend. That said ...

First, you'd confirm that you have all your important files backed up, which you should already be doing regardless of this endeavor.

Next, here are the Debian download links for the base package for R as a .deb archive from the unstable Sid repo...

https://packages.debian.org/sid/all/r-base/download

... where you'd download what appears to be r-base_4.0.3-1_all.deb as of this writing.

Then from the terminal, in the directory where you downloaded the .deb archive, you'd execute: apt install ./r-base_4.0.3-1_all.deb

Best of luck to you.
Marsik
Level 1
Level 1
Posts: 5
Joined: Sat Jan 23, 2021 12:52 pm

Re: Installing latest version of R on LMDE 3

Post by Marsik »

I downloaded this to my Downloads directory and executed the commands from there (i.e., pwd = /home/marsel/Downloads). The suggested command could not be executed, yielding the following error message:

apt install ./r-base_4.0.3-1_all.deb
Reading package lists... Done
E: Unsupported file ./r-base_4.0.3-1_all.deb given on commandline

Any idea what might have caused this?
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: Installing latest version of R on LMDE 3

Post by JoeFootball »

Marsik wrote: Any idea what might have caused this?
Is that the correct filename for the package you downloaded?

Edit: In the past month, the version number has indeed changed.
Marsik
Level 1
Level 1
Posts: 5
Joined: Sat Jan 23, 2021 12:52 pm

Re: Installing latest version of R on LMDE 3

Post by Marsik »

Ups, my bad. Yes, that was indeed the problem, many apologies! However, this led to another error message, see below. I am not sure what to make of the phrasing "but is to be installed" in this context. From previous attempts at installing R, version 3.3 is still installed on my computer. Does the error message suggest that I should uninstall this version first or is this a problem arising from the actual installation procedure of version 4.0.4.1, e.g., that version 3.3 was installed again instead of version 4?

apt install ./r-base_4.0.4-1_all.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'r-base' instead of './r-base_4.0.4-1_all.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 4.0.4-1) but 3.3.3-1 is to be installed
Depends: r-recommended (= 4.0.4-1) but 3.3.3-1 is to be installed
E: Unable to correct problems, you have held broken packages.
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: Installing latest version of R on LMDE 3

Post by JoeFootball »

Marsik wrote: ... this led to another error message ...
And thus the chasing down dependencies that I mentioned, which may be made even more challenging with an unstable package on an unsupported OS.

Regardless, if you'd still like to pursue this, I would verify backups, and try uninstalling whatever version of R that exists, and try installing the Sid version thereafter.
Locked

Return to “Software & Applications”