Error message of broken packages while tryIng to install R on Ubuntu - r

I am trying to install R by trying the following command on Ubuntu 18.04x64:
sudo apt-get update
sudo apt-get -y install r-base
following this tutorial (step 6)
but I get :
I tried to solve it with :
sudo add-apt-repository ppa:marutter/rrutter
sudo apt-get update
sudo apt-get install r-base r-base-dev
based on this answer but I still take the same error. Any suggestions?

Related

How to downgrade R version in ubuntu 18.04

I installed R version 3.4.4-1ubuntu1 How do I downgrade to 3.2.2?
I tried this solution but it didn't work
sudo apt-get remove r-base-core
sudo apt-get autoremove
sudo apt-get install r-base-core=3.2.2

Installing R devtools package on WSL

The problem:
I'm trying to install the devtools package for R. I'm using Ubuntu 18.04 LTS on WSL, the Windows Subsystem for Linux.
I'm able to install some packages just fine with a simple call to install.packages() from within R on WSL. However, other packages seem to give me trouble.
None of the following methods I've tried seem to work:
* I've tried installing the package with install.packages().
* I've tried installing from source into /usr/local/lib/R/site-library.
* I've tried installing from source into a personal library.
Error message:
I was recieving an error message like that discussed here, but I was unable to fix the problem by editing unpackPkgZip because it didn't exist.
The Question:
How can I install devtools on WSL?
Solution:
I was able to fix the problem by starting over. I uninstalled Ubuntu and then reinstalled it. With a fresh install of Ubuntu 18.04 I followed these instructions. There are other online tutorials which probably work just fine, but I followed this one. You can ignore the bit about installing an rstudio server and the fsl package if you wish.
# Install R on WSL
sudo apt-get update -qq -y
sudo apt-get install -y wget git
OS_DISTRIBUTION=$(lsb_release -cs)
wget -O- http://neuro.debian.net/lists/${OS_DISTRIBUTION}.us-nh.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
sudo apt-get update
sudo apt-get install libopenblas-base r-base
sudo apt-get update -qq -y
sudo apt-get install -y libgit2-dev
sudo apt-get install -y libcurl4-openssl-dev libssl-dev
sudo apt-get install -y zlib1g-dev libssh2-1-dev libpq-dev libxml2-dev
#sudo apt-get install -y libhdf5 # This didn't work.
Now try installing devtools in R.
# Install devtools
install.packages("devtools", repos = "https://cran.rstudio.com/")
Permission error:
If you encounter a permission error like the following...
Warning in install.packages("edgeR") :'lib = "/usr/local/lib/R/site-library"' is not writable Would you like to use a personal library instead? (y/n)
...you need to provide the user with write access to the directory where R packages are installed (see here). Try changing the group ownership of this directory:
# Who has ownership of /usr/local/lib/R/site-library/?
ls -l /usr/local/lib/R/
# drwxrwsr-x 1 root staff 512 Jul 18 21:38 site-library
# Change ownership.
sudo chgrp twesleyb /usr/local/lib/R/site-library/
ls -l /usr/local/lib/R/
#drwxrwxr-x 1 root twesleyb 512 Jul 18 21:38 site-library
# In this case I have write access, but in case you need to add it, try:
# $ sudo chmod g+w /usr/local/lib/R/site-library
You should now be able to install.packages("package").
I'm a linux novice, but I think this is an okay thing to do.
Update:
You can also try following duckmayr's instructions.

Installing r-base; Depenency: r-recommended missing?

Hello I am trying to install r-base for Ubuntu 16.04.
I have followed the steps at https://cran.r-project.org/bin/linux/ubuntu/README.html
However I am getting a 'unmet dependencies' error when I run sudo apt-get install r-base
The following packages have unmet dependencies:
r-base : Depends: r-recommended (= 3.4.4-1xenial0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Any ideas for getting around this?
Thanks in advance!
Running the following commands seems to have solved my problem:
sudo apt --fix-broken install
sudo apt-get update
sudo apt-get upgrade
Running the following fixed it for me, but this solution uses r-base-dev not r-base (r-base still didn't work).
sudo apt --fix-broken install
sudo apt autoremove
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base-dev
Make sure to check in the software and properties that if your restricted and universe repositories are enabled. Here's a link with more information.
I started getting this issue because I added the wrong apt-repository for my version of Ubuntu (focal fossa instead of bionic).
Solved by doing sudo vim /etc/apt/sources.list, then deleting any lines containing focal

Installing R and RStudio on Chromebook Samsung 3

I have been trying to but struggling to install R and RStudio on my Chromebook Samsung 3. I have it set-up with Crouton with XFCE/Xiwi and use Trusty. I can install R just fine but either can't install Rstudio at all or can get the icon for Rstudio to show up but nothing happens when I click on it. Can someone give me a process on how to install these effectively on my device?
UPDATE 2020:
I am no longer using Crouton, but rather the built in Linux option (Crostini). In the Linux terminal, I did the following:
sudo apt-get update; sudo apt-get upgrade; sudo apt-get update --fix-missing; sudo apt autoclean; sudo apt-get clean; sudo apt-get autoremove
sudo apt install -y gnupg2
sudo apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
sudo vi /etc/apt/sources.list
Add this line. Can use a different mirror if desired. (Note: older versions of Crostini were running Stretch by default instead of Buster)
deb http://cran.rstudio.com/bin/linux/debian buster-cran35/
Then back in the terminal
sudo apt-get install xclip
sudo apt install -y r-base r-base-dev
sudo apt-get install gdebi-core
sudo apt install -y libgstreamer1.0 libgstreamer-plugins-base1.0 libxslt-dev libnss3
sudo apt --fix-broken install
sudo curl -o rstudio.deb https://download1.rstudio.org/desktop/bionic/amd64/rstudio-1.2.5033-amd64.deb
sudo dpkg -i rstudio.deb
sudo apt-get update; sudo apt-get upgrade; sudo apt --fix-broken install; sudo apt-get update --fix-missing; sudo apt autoclean; sudo apt-get clean; sudo apt-get autoremove
ORIGINAL ANSWER:
It admittedly took me a long time, but I was finally able to install R and RStudio on my Chromebook Samsung 3. I have it set-up with Crouton with XFCE/Xiwi and use Trusty. After setting up Crouton, etc. here is what I had to do in the Linux terminal:
sudo apt-get install software-properties-common
sudo apt-get install selinux-policy-default
sudo apt-get install libqpol1
Add these lines:
deb https://<FOO>/bin/linux/ubuntu trusty/
deb https://<FOO>/ trusty-backports main restricted universe
to file
/etc/apt/sources.list
(replace FOO with the CRAN mirror of your choice and replace trusty if applicable)
Terminal:
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo add-apt-repository ppa:marutter/rrutter
sudo apt update
sudo apt upgrade
sudo apt upgrade r-base r-base-dev
sudo apt-get install gdebi-core
wget https://download2.rstudio.org/rstudio-server-1.1.442-amd64.deb
sudo gdebi rstudio-server-1.1.442-amd64.deb
wget https://download1.rstudio.org/rstudio-0.99.896-amd64.deb
sudo apt-get install libxslt1-dev
sudo gdebi rstudio-0.99.896-amd64.deb
cd /usr/bin/
rstudio
source
source
source
source

Cannot install RStudio on CentOS 6.4

I am trying to install RStudio on Centos 6.4 with an already installed R version.
I got the following error:
error: Failed dependencies:
libcrypto.so.6()(64bit) is needed by rstudio-server-0.97.336-x86_64
libgfortran.so.1()(64bit) is needed by rstudio-server-0.97.336-x86_64
libssl.so.6()(64bit) is needed by rstudio-server-0.97.336-x86_64
Any hint will be highly appreciated.
I fixed this error following this link:
http://jermdemo.blogspot.com.es/2011/08/installing-rstudio-server-on-scientific.html
You have to install some dependencies:
yum install libcrypto.so.6 -y
yum install libgfortran.so.1 -y
yum install libssl.so.6 -y
yum install openssl098e-0.9.8e -y
yum install gcc41-libgfortran-4.1.2 -y
yum install pango-1.28.1 -y
and the tricky one:
wget ftp.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/compat-
libgfortran-41-4.1.2-39.el6.x86_64.rpm
rpm -Uvh compat-libgfortran-41-4.1.2-39.el6.x86_64.rpm
and install Rstudio with no-deps flag:
rpm -Uvh --nodeps rstudio-server-0.97.336-x86_64.rpm
rstudio-server verify-installation

Resources