Page 1 of 1

R 3.6 for Linux Mint 19.1

Posted: Mon May 27, 2019 4:46 pm
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. :)

Re: R 3.6 for Linux Mint 19.1

Posted: Mon May 27, 2019 6:12 pm
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.

Re: R 3.6 for Linux Mint 19.1

Posted: Tue May 28, 2019 4:51 pm
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.

Re: R 3.6 for Linux Mint 19.1

Posted: Tue May 28, 2019 4:55 pm
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:~$

Re: R 3.6 for Linux Mint 19.1

Posted: Tue May 28, 2019 5:08 pm
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.

Re: R 3.6 for Linux Mint 19.1

Posted: Thu Jun 27, 2019 8:09 am
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!!!

Re: R 3.6 for Linux Mint 19.1

Posted: Mon Jul 22, 2019 12:35 pm
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.

Re: R 3.6 for Linux Mint 19.1

Posted: Tue Sep 24, 2019 5:33 pm
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.

Re: R 3.6 for Linux Mint 19.1

Posted: Sun Nov 03, 2019 5:54 pm
by Lukasmp3
Thank you! Worked for me.

Re: R 3.6 for Linux Mint 19.1

Posted: Sat Jan 04, 2020 6:09 am
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!

Re: R 3.6 for Linux Mint 19.1

Posted: Sat Jan 04, 2020 7:09 am
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

Re: R 3.6 for Linux Mint 19.1

Posted: Sat Jan 04, 2020 8:17 am
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?

Re: R 3.6 for Linux Mint 19.1

Posted: Fri Jan 10, 2020 9:30 am
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.

Re: R 3.6 for Linux Mint 19.1

Posted: Thu Jan 16, 2020 4:54 am
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

Re: R 3.6 for Linux Mint 19.1

Posted: Sat Jan 18, 2020 10:25 am
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

Re: R 3.6 for Linux Mint 19.1

Posted: Fri Jul 10, 2020 5:13 pm
by leleoveiga
THANK YOUU!! I just created an account only to thank you so much!! <3 :D :D