R 3.6 for Linux Mint 19.1

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
erzebet
Level 1
Level 1
Posts: 3
Joined: Mon May 27, 2019 3:25 pm

R 3.6 for Linux Mint 19.1

Post by erzebet »

After a whole day trying to install R 3.6 on Linux Mint 19.1 based on many tutorials that didn't work for me, I bring to you:

THE REAL TUTORIAL TO INSTALL R 3.6 ON LINUX MINT 19.1

Sorry if my English isn't good enough, I'm from Argentina.
This are the steps:

Remove old R (if you have)
The best way to do this is through the interface. Not using the terminal.
I have it in spanish, logically, but you can find it like a "software origin manager" or something. (Menu>Administration>...)
Relax, not big deal.
Captura de pantalla -2019-05-27 16-57-53.png
So here you have to delete all the repositories that are related to CRAN.
Could be that you don't have any repositories there. Don't worry, it could be because you had installed R without specifying it.
Then uninstall R with these commands:

Code: Select all

sudo apt purge r-base* r-recommended r-cran-*
sudo apt autoremove
sudo apt update
Install R 3.6
Put these on the terminal:

Code: Select all

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
The second command will work, but we have to make something else.
Linux Mint has a problem with this command to add repositories. That's why I spend all day trying to install R.
And I tried too adding it through the interface but does not work.
The repository is loaded, but we have to edit it in the interface I mentioned above.
Once we entered to the ""software origin manager" or something", select the repository of CRAN and click edit.
You will notice that at the end of the URL, it's wrong written.
It says bionic main instead of bionic-cran35/.
Correct it.
Then put these on the terminal:

Code: Select all

sudo apt update
sudo apt install r-base
That's all folks. Hope it work for you. :)
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

Re: R 3.6 for Linux Mint 19.1

Post by gm10 »

erzebet wrote:
Mon May 27, 2019 4:46 pm

Code: Select all

sudo add-apt-repository https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
Linux Mint has a problem with this command to add repositories.
To explain what is happening here, the issue is that your command line is incomplete, so the tool enables a mode trying to guess the missing parts for you.

Correctly written the command must be like this, then your repository gets added just like you want it without modifications:

Code: Select all

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
In other words, it's indeed not a bug, but a (slightly obscure) feature.
erzebet
Level 1
Level 1
Posts: 3
Joined: Mon May 27, 2019 3:25 pm

Re: R 3.6 for Linux Mint 19.1

Post by erzebet »

Yes, that's the command that is supposed to work, but it doesn't.
It says that is wrong. So I tried that way and it worked for me.
That's why I made this post.
erzebet
Level 1
Level 1
Posts: 3
Joined: Mon May 27, 2019 3:25 pm

Re: R 3.6 for Linux Mint 19.1

Post by erzebet »

Here's the output:

>> eliana@Banana:~$ sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
>> [sudo] contraseña para eliana:
>> Entrada mal formada, repositorio no agregado.
>> eliana@Banana:~$
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

Re: R 3.6 for Linux Mint 19.1

Post by gm10 »

Ah, I had forgotten about that bug, I had a fix submitted before 19.1 even released but unfortunately the fix didn't get included and Clem didn't consider it critical enough to release the fix for 19.1 at all unfortunately...

It works correctly with my version of the command from my PPA, but of course that doesn't help you on regular LM 19.1.
KingLouie
Level 1
Level 1
Posts: 1
Joined: Thu Jun 27, 2019 8:05 am

Re: R 3.6 for Linux Mint 19.1

Post by KingLouie »

I only register to say : THANK YOU!!!!! I took me just a half day to find your post and not a whole day - but now it works. So again: thank you!!!
venik212
Level 1
Level 1
Posts: 46
Joined: Thu Aug 25, 2011 12:05 pm

Re: R 3.6 for Linux Mint 19.1

Post by venik212 »

THANK YOU erzebet for showing us how to install R 3.6 -- I spent two days (I always suspect myself before I blame others) in trying to get around this "non-critical" bug. With your post I was finally able t do it.
biff1
Level 1
Level 1
Posts: 1
Joined: Tue Sep 24, 2019 5:31 pm

Re: R 3.6 for Linux Mint 19.1

Post by biff1 »

Also registered just to say thank you to everyone. I'm trying to make a full switch over from Windows, and being stuck at 3.4 was going to be a serious problem for me.
Lukasmp3
Level 1
Level 1
Posts: 7
Joined: Tue Dec 25, 2018 3:15 am

Re: R 3.6 for Linux Mint 19.1

Post by Lukasmp3 »

Thank you! Worked for me.
mta01bk
Level 1
Level 1
Posts: 4
Joined: Sat Jan 04, 2020 6:06 am

Re: R 3.6 for Linux Mint 19.1

Post by mta01bk »

I still get this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
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 (>= 3.6.2-1trusty) but it is not going to be installed
Depends: r-recommended (= 3.6.2-1trusty) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
One of the reasons for switching to linux was that I thought R was native to linux? I am amazed at the number of online posts that imply using 3.4 is an option!
JeremyB
Level 20
Level 20
Posts: 11771
Joined: Fri Feb 21, 2014 8:17 am

Re: R 3.6 for Linux Mint 19.1

Post by JeremyB »

mta01bk wrote:
Sat Jan 04, 2020 6:09 am
I still get this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
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 (>= 3.6.2-1trusty) but it is not going to be installed
Depends: r-recommended (= 3.6.2-1trusty) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
One of the reasons for switching to linux was that I thought R was native to linux? I am amazed at the number of online posts that imply using 3.4 is an option!
Are you using Mint 17 as Mint 17 is no longer supported
mta01bk
Level 1
Level 1
Posts: 4
Joined: Sat Jan 04, 2020 6:06 am

Re: R 3.6 for Linux Mint 19.1

Post by mta01bk »

No I am running mint 19.3.

Trying to install r-base-core by itself I am told it requires libcurl3, but libcurl4 is installed with mint 19.3.
~$ sudo apt install r-base-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
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-core : Depends: libcurl3 (>= 7.28.0) but it is not going to be installed
Depends: libpng12-0 (>= 1.2.13-4) but it is not installable
Depends: libreadline6 (>= 6.0) but it is not installable
I am pretty new to linux but looks like it is failing because it is asking for previous versions of packages?
mta01bk
Level 1
Level 1
Posts: 4
Joined: Sat Jan 04, 2020 6:06 am

Re: R 3.6 for Linux Mint 19.1

Post by mta01bk »

So I take it no one knows what the issue is?

If procedures change for every update to mint it makes tutorials like this a waste of time.

Back to Windows it is.
veverkak
Level 1
Level 1
Posts: 1
Joined: Thu Jan 16, 2020 4:35 am

Re: R 3.6 for Linux Mint 19.1

Post by veverkak »

Hi!

Thank you very much for advices how install R 3.6 for Linux Mint! I have just successfully finished, but I still have problem to install new R packages and I do not know why. I did not have such problems when install packages to R using Windows.

I am beginner at using Linux in general so I would be grateful for every recommendation.

There are messages which I get during installation in R studio:

Installing package into ‘/home/veronika/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib ... -13.tar.gz'
Content type 'application/x-gzip' length 3224440 bytes (3.1 MB)
==================================================
downloaded 3.1 MB

* installing *source* package ‘ade4’ ...
** package ‘ade4’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c adesub.c -o adesub.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=. -fstack-protector-strong -Wformat


..... I avoided the similar messages, the next one should be important:

/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'ade4.so' failed
make: *** [ade4.so] Error 1
ERROR: compilation failed for package ‘ade4’
* removing ‘/home/veronika/R/x86_64-pc-linux-gnu-library/3.6/ade4’
Warning in install.packages :
installation of package ‘ade4’ had non-zero exit status

The downloaded source packages are in
‘/tmp/Rtmp7x4QaU/downloaded_packages’


Thanks!

Veronika
mta01bk
Level 1
Level 1
Posts: 4
Joined: Sat Jan 04, 2020 6:06 am

Re: R 3.6 for Linux Mint 19.1

Post by mta01bk »

I've tried installing in Ubuntu as well. It works but when I load up R studio it closes itself as soon as I start installing packages.

I am amazed given that R is open source the primary support is for Windows and Mac.

Is someone expected to find their own solution to these issues and try again for the next upgrade?

No thanks
leleoveiga
Level 1
Level 1
Posts: 1
Joined: Fri Jul 10, 2020 4:47 pm

Re: R 3.6 for Linux Mint 19.1

Post by leleoveiga »

THANK YOUU!! I just created an account only to thank you so much!! <3 :D :D
Post Reply

Return to “Tutorials”