2

I just installed Ubuntu 18.04 on my testbed laptop. Total fresh install (chose the 'minimal' option). The first two things I did were install R 3.5 and R Studio 1.1.453. If I open up a fresh install of R and just let it sit idle for 30 minutes or so I eventually get the error "Error: Unable to establish connection with R session".

At this point in time I can't do anything in R Studio and I have to xkill it and reload everything to continue programming. An internet search reveals that this issue has been popping up repeatedly since people have been installing R/R Studio on Ubuntu machines that use GNOME. Am not sure if GNOME is the root cause but it's interesting.

Anybody solved this? Or maybe you run R 3.5 fine on Ubuntu 18.04 without issue. Please let me know. I can only run for 30 minutes or so before this issue brings my system down. And my system is a fresh install of Bionic Beaver with just R on it. Weird.

------ and for those wondering ------

installation for R was via

sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo apt-get update
sudo apt-get install r-base r-base-dev

and R Studio was installed via this link through the Ubuntu software center https://download1.rstudio.org/rstudio-xenial-1.1.453-amd64.deb

and it is speculated that the preview release of R Studio may fix this (TBD) https://s3.amazonaws.com/rstudio-ide-build/desktop/trusty/amd64/rstudio-1.2.792-amd64.deb

  • R in Ubuntu 18.04 currently is at version 3.4.4. You likely installed from another source? – vanadium Jul 16 '18 at 17:04
  • @vanadium I installed from here cran.r-project.org/bin/linux/ubuntu/bionic-cran35 using sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/" then sudo apt-get install r-base r-base-dev. I installed the keys as well prior. – stackinator Jul 16 '18 at 17:31
  • 2
    OK, please add to your question because this is essential information. My version from the standard Ubuntu PPA works fine. Also indicate how you installed R studio. – vanadium Jul 16 '18 at 17:42
3

I did your steps on my clean Ubuntu 18.04 LTS VM:

sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo apt-get update
sudo apt-get install r-base r-base-dev

Then tried to run R:

Then installed RStudio:

cd ~/Downloads
wget https://download1.rstudio.org/rstudio-xenial-1.1.453-amd64.deb
sudo apt-get install ./rstudio-xenial-1.1.453-amd64.deb

it launches and runs normally:

RStudio with R 3.5.2 on Ubuntu 18.04 LTS

Afterwards I tried newer version and it works too.

For your information below is R-related packages list:

$ dpkg -l | grep "^ii  r-"
ii  r-base                                3.5.2-1bionic                           all          GNU R statistical computation and graphics system
ii  r-base-core                           3.5.2-1bionic                           amd64        GNU R core of statistical computation and graphics system
ii  r-base-dev                            3.5.2-1bionic                           all          GNU R installation of auxiliary GNU R packages
ii  r-base-html                           3.5.2-1bionic                           all          GNU R html docs for statistical computing system functions
ii  r-cran-boot                           1.3-20-1.1cranBionic0                   all          GNU R package for bootstrapping functions from Davison and Hinkley
ii  r-cran-class                          7.3-15-1bionic0                         amd64        GNU R package for classification
ii  r-cran-cluster                        2.0.7-1-1cranBionic0                    amd64        GNU R package for cluster analysis by Rousseeuw et al
ii  r-cran-codetools                      0.2-16-1bionic0                         all          GNU R package providing code analysis tools
ii  r-cran-foreign                        0.8.70-1cranArtful0~ubuntu18.04.1~ppa1  amd64        GNU R package to read/write data from other stat. systems
ii  r-cran-kernsmooth                     2.23-15-3cranArtful0~ubuntu18.04.1~ppa1 amd64        GNU R package for kernel smoothing and density estimation
ii  r-cran-lattice                        0.20-38-1cran1bionic0                   amd64        GNU R package "Trellis Graphics for R"
ii  r-cran-mass                           7.3-51.1-1bionic0                       amd64        GNU R package of Venables and Ripley's MASS
ii  r-cran-matrix                         1.2-15-1bionic0                         amd64        GNU R package of classes for dense and sparse matrices
ii  r-cran-mgcv                           1.8-26-1bionic0                         amd64        GNU R package for multiple parameter smoothing estimation
ii  r-cran-nlme                           3.1.137-1cranBionic0                    amd64        GNU R package for (non-)linear mixed effects models
ii  r-cran-nnet                           7.3-12-2cranArtful0~ubuntu18.04.1~ppa1  amd64        GNU R package for feed-forward neural networks
ii  r-cran-rpart                          4.1-13-1cranBionic0                     amd64        GNU R package for recursive partitioning and regression trees
ii  r-cran-spatial                        7.3-11-2cranArtful0~ubuntu18.04.1~ppa1  amd64        GNU R package for spatial statistics
ii  r-cran-survival                       2.43-3-1cran1bionic0                    amd64        GNU R package "Survival Analysis"
ii  r-doc-html                            3.5.2-1bionic                           all          GNU R html manuals for statistical computing system
ii  r-recommended                         3.5.2-1bionic                           all          GNU R collection of recommended packages [metapackage]

and their sources:

$ apt-cache policy $(dpkg -l | grep "^ii  r-" | awk '{print $2}')
r-base:
  Installed: 3.5.2-1bionic
  Candidate: 3.5.2-1bionic
  Version table:
 *** 3.5.2-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     3.5.1-2bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.1-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.0-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.4.4-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages
r-base-core:
  Installed: 3.5.2-1bionic
  Candidate: 3.5.2-1bionic
  Version table:
 *** 3.5.2-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     3.5.1-2bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.1-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.0-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.4.4-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-base-dev:
  Installed: 3.5.2-1bionic
  Candidate: 3.5.2-1bionic
  Version table:
 *** 3.5.2-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     3.5.1-2bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.1-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.0-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.4.4-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages
r-base-html:
  Installed: 3.5.2-1bionic
  Candidate: 3.5.2-1bionic
  Version table:
 *** 3.5.2-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     3.5.1-2bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.1-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.0-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.4.4-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages
r-cran-boot:
  Installed: 1.3-20-1.1cranBionic0
  Candidate: 1.3-20-1.1cranBionic0
  Version table:
 *** 1.3-20-1.1cranBionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     1.3-20-1.1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages
r-cran-class:
  Installed: 7.3-15-1bionic0
  Candidate: 7.3-15-1bionic0
  Version table:
 *** 7.3-15-1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     7.3-14-2cranArtful0~ubuntu18.04.1~ppa1 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     7.3-14-2build1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-cluster:
  Installed: 2.0.7-1-1cranBionic0
  Candidate: 2.0.7-1-1cranBionic0
  Version table:
 *** 2.0.7-1-1cranBionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     2.0.6-2build1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-codetools:
  Installed: 0.2-16-1bionic0
  Candidate: 0.2-16-1bionic0
  Version table:
 *** 0.2-16-1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     0.2-15-1.1cranBionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     0.2-15-1.1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages
r-cran-foreign:
  Installed: 0.8.70-1cranArtful0~ubuntu18.04.1~ppa1
  Candidate: 0.8.70-1cranArtful0~ubuntu18.04.1~ppa1
  Version table:
 *** 0.8.70-1cranArtful0~ubuntu18.04.1~ppa1 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     0.8.69-1build1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-kernsmooth:
  Installed: 2.23-15-3cranArtful0~ubuntu18.04.1~ppa1
  Candidate: 2.23-15-3cranArtful0~ubuntu18.04.1~ppa1
  Version table:
 *** 2.23-15-3cranArtful0~ubuntu18.04.1~ppa1 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     2.23-15-3build1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-lattice:
  Installed: 0.20-38-1cran1bionic0
  Candidate: 0.20-38-1cran1bionic0
  Version table:
 *** 0.20-38-1cran1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     0.20-35-1cranBionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     0.20-35-1build1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-mass:
  Installed: 7.3-51.1-1bionic0
  Candidate: 7.3-51.1-1bionic0
  Version table:
 *** 7.3-51.1-1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     7.3-51-1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     7.3-50-1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     7.3-49-1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-matrix:
  Installed: 1.2-15-1bionic0
  Candidate: 1.2-15-1bionic0
  Version table:
 *** 1.2-15-1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     1.2-14-1cranBionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     1.2-12-1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-mgcv:
  Installed: 1.8-26-1bionic0
  Candidate: 1.8-26-1bionic0
  Version table:
 *** 1.8-26-1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     1.8-25-1cran1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     1.8-24-1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     1.8-23-1cranBionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     1.8-23-1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-nlme:
  Installed: 3.1.137-1cranBionic0
  Candidate: 3.1.137-1cranBionic0
  Version table:
 *** 3.1.137-1cranBionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     3.1.131-3build1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-nnet:
  Installed: 7.3-12-2cranArtful0~ubuntu18.04.1~ppa1
  Candidate: 7.3-12-2cranArtful0~ubuntu18.04.1~ppa1
  Version table:
 *** 7.3-12-2cranArtful0~ubuntu18.04.1~ppa1 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     7.3-12-2build1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-rpart:
  Installed: 4.1-13-1cranBionic0
  Candidate: 4.1-13-1cranBionic0
  Version table:
 *** 4.1-13-1cranBionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     4.1-13-1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-spatial:
  Installed: 7.3-11-2cranArtful0~ubuntu18.04.1~ppa1
  Candidate: 7.3-11-2cranArtful0~ubuntu18.04.1~ppa1
  Version table:
 *** 7.3-11-2cranArtful0~ubuntu18.04.1~ppa1 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     7.3-11-2build1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-cran-survival:
  Installed: 2.43-3-1cran1bionic0
  Candidate: 2.43-3-1cran1bionic0
  Version table:
 *** 2.43-3-1cran1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     2.43-1-1cran1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     2.42-6-1cran1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     2.42-3-1cranBionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     2.41-3-2build1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
r-doc-html:
  Installed: 3.5.2-1bionic
  Candidate: 3.5.2-1bionic
  Version table:
 *** 3.5.2-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     3.5.1-2bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.1-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.0-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.4.4-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages
r-recommended:
  Installed: 3.5.2-1bionic
  Candidate: 3.5.2-1bionic
  Version table:
 *** 3.5.2-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     3.5.1-2bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.1-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.0-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.4.4-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages

So the problem is on your side.

0

I think that I did follow your steps. I "cleaned" my system to the best of my abilities (as previously described; see below) and then did

sudo apt-get install r-base

This seemed (as I previously said on the Ubuntu Mate Community list, from which you told me to switch the discussion to this location) to run without complaint, but produced no executable.

I tried

dpkg -l | grep "^ii -r"

just now, following your example, and got no output whatever. So it would seem that "dpkg" thinks that r-base has not been installed.

But the output from "sudo apt-get install r-base" seems to say that it has been installed. What is going on?

Added: I have solved the problem. Elsewhere it was suggested to me that I try doing

dpkg -l r-base-core

This produced the enlightening output:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-  pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name             Version       Architecture  Description
+++-================-=============-=============-======================================
ii  r-base-core      3.5.2-1bionic amd64         GNU R core of statistical computation

The nature of the message prompted me to try

sudo apt purge r-base-core

which ran and said that it was removing a whole lot of stuff.

I then tried

 sudo apt-get install r-base-core

which ran and gave a whole lot more output than was previously produced when I ran "sudo apt-get install r-base". (Note: I had been typing r-base and NOT r-base-core.) It indicated that it was doing lots of stuff that looked promising in respect of actually installing R.

And in fact the promise was fulfilled. I then started R and got:

R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

Ta-da!!!

The problem may have been that previously I had been saying

"sudo apt-get install r-base" rather than

"sudo apt-get install r-base-core".

It is possible that the latter is needed if R has previously been installed from source, but otherwise just "r-base" is sufficient. I am not sufficiently knowledgeable to say. Others may be able to provide insight.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.