Install R 3.1.2 on Wheezy 7.8 (Raspbian) fails - r

I'm a newbie to Linux and try to install the latest R version on my Raspberry.
My Raspberry runs on Wheezy 7.8.
I followed instructions on CRAN, so I
added
deb http://cran.rstudio.com/bin/linux/debian wheezy-cran3/
to /etc/apt/sources.list
ran apt-get update which was successful and gave me only a "signature error" for the public key as pointed out on the CRAN-site
ran apt-get install r-base
But the result of the last command is
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.1.2-1~wheezycran3.0) but it is not going to be installed
Depends: r-recommended (= 3.1.2-1~wheezycran3.0) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
Recommends: r-doc-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I tried to install R-2.15 before and then run the above commands. R-2.15 could be installed successfuly, but I'd need R-3* really.
I did browse the web, but couldn't find any useful hints for my specific problem, so I appreciate any support you could give me.
Thanks!
If it is of any use:
apt-cache policy r-base gives
r-base:
Installed: (none)
Candidate: 3.1.2-1~wheezycran3.0
Version table:
3.1.2-1~wheezycran3.0 0
500 http://cran.rstudio.com/bin/linux/debian/ wheezy-cran3/ Packages
3.1.0-1~wheezycran3.0 0
500 http://cran.rstudio.com/bin/linux/debian/ wheezy-cran3/ Packages
2.15.1-4 0
500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages
apt-cache policy r-base-core gives
r-base-core:
Installed: (none)
Candidate: 2.15.1-4
Version table:
2.15.1-4 0
500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages
uname -a gives
Linux raspberrypi 3.18.5+ #744 PREEMPT Fri Jan 30 18:19:07 GMT 2015 armv6l GNU/Linux

I had the same situation and decided to install that from the source code instead of install R from the repository(apt-get command).
Here is the command I run on my Raspberry Pi 2.
I could install and run R(3.1.2) sucessfully.
It might not be complete answer for you because I might already installed the library like gcc you did not have before. If you encounter the other issue, please let me know. I would like to solve it.
Just as a side note on this topic, because sudo make install process took a long time(maybe over a hour. I'm not sure because I feel asleep before I knew it...), I recommend you to do this when you have enough or before going to sleep like me.
wget http://cran.rstudio.com/src/base/R-3/R-3.1.2.tar.gz
mkdir R_HOME
mv R-3.1.2.tar.gz R_HOME/
cd R_HOME/
tar zxvf R-3.1.2.tar.gz
cd R-3.1.2/
sudo apt-get install gfortran libreadline6-dev libx11-dev libxt-dev
./configure
make
sudo make install
R

The cause of your problem is likely that the cran repository provides armel versions of the packages, and not armhf (which is the expected architecture for your RPI). If this is right, then you have two solutions:
The first work-around could be to download the armel version of the packages and then force their installation despite the architecture mismatch. It is supposed to work according to the Debian wiki, although you may experience performance issues:
The CPU in the Raspberry Pi implements the ARMv6 ISA (with VFP2) and
is thus incompatible with the Debian armhf port baseline of ARMv7+VFP3
and ARM hardware-floating-point ports for other distributions, which
all have the same baseline. It is compatible with Debian armel
(armv4t, soft(emulated) FP), but floating-point tasks will be slow
when running the Debian armel port.
To do that, you can try to reinstall the packages by specifying the armel architecture, for example:
apt-get install r-base:armel
If it doesn't work this way, you can otherwise download the packages from http://cran.r-project.org/bin/linux/debian/wheezy-cran3/ and install them manually using a commandline like:
dpkg --install --force-architecture xxxx_armel.deb yyyy_armel.deb zzzz_armel.deb
The other solution would be to compile R from its source.

I solved my initial question by upgrading Wheezy to Jessie. I am not an expert, but Jessie seems to be the current testing version of Debian, while Wheezy is the stable release - see here.
For upgrading, I followed the instructions here, or here, or here. Note: Upgrading takes quite a while and during the process you're required to answer some questions.
A word of caution though: Jessie is still testing and some people recommend not to use it yet, for a discussion see e.g. here.
I did set it up completely from a new completely new image, and it works well.
After having upgraded to Jessie I installed R-3.1.1. using
sudo apt-get install r-base
And I'd like to thank all those who have answered my question and given alternative ways of solving the problem above.

I'm able to install R-3.1.2 into raspbian using answer from teramonagi. I confirm it can install successfully on Raspberry Pi model B/B+.
However, before you can actually use R (install packages and run some R scripts), you have to increase the swap file size for Raspberry Pi due to lack of RAM (This service works very similar to page file in window, it kicks in when RAM usage is high). You can configure it by edit one of the config file by enter command below in LX terminal.
sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=100 #(change 100 to 512 or 1024, up to you, save the file)
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start #(restart swap file service with new swap file size)
Take note though, some users argued that increase swap file size can actually ruin your SD card. So apply this change at your own risk. I've been running my Pi with this configuration for my R automation for 1 month now. No issue so far.
Hope this helps.
Edit: If you are using model B/B+, i recommend to configure swap file size first then compile R.

That's what I've done to update my r-base on wheezy:
HOW TO UPDATE r-base 2.15 to 3.x ON DEBIAN WHEEZY
add these lines at the end of "/etc/apt/sources.list"
deb http://cran.revolutionanalytics.com/bin/linux/debian wheezy-cran3/
deb-src http://cran.revolutionanalytics.com/bin/linux/debian wheezy-cran3/
add the missing publich key of cran
gpg --keyserver pgpkeys.mit.edu --recv-key 06F90DE5381BA480
gpg -a --export 06F90DE5381BA480 | sudo apt-key add -
update and upgrade
apt-get update
aptitude -t wheezy-cran3 install r-base r-base-dev

Related

Installing RStan using Rocker

I would like to be able to install the rstan package from binaries (without compiling from source). This blog post by Dirk Eddelbuettel has some clear instructions that should enable me to do exactly that. However I get the following error message when I try and install RStan. Here are the commands I used.
docker run --rm -ti rocker/r-ubuntu:18.04 bash
apt-get update; apt-get dist-upgrade -y
apt-get install -y r-cran-rstan
This produces the following error message.
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-cran-rstan : Depends: r-cran-v8 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Installing the R tidyverse package using Dirk's instructions works fine. I am working on a Ubuntu OS within the Windows Subsystem for Linux (WSL-2).
These things can happen -- the best best is to then try
sudo apt install r-cran-v8
which reveals r-cran-node64 is required but not available.
I work much more with 20.04 than 18.04 so I don't what is going on here. I would recommend asking on the r-sig-debian list if anybody else has seen this.
PS And if you try 20.04 instead it works there.

R, issue "unable to load shared object cairo.so" on Linux CentOS 7

I've been using R with ggplot2 and other packages on my Linux CentOS 7 for a long time.
Today, all of a sudden, it stopped working.
When I call the png() function in my script, it generates the following errrors:
Warning messages:
1: In png(heatmap_file) :
unable to load shared object '/usr/lib64/R/library/grDevices/libs//cairo.so':
/lib64/libcairo.so.2: undefined symbol: FT_Get_Var_Design_Coordinates
2: In png(heatmap_file) : failed to load cairo DLL
I tried to update the cairo package many times but nothing worked out so far.
What can I do?
Thanks!
Your version of cairo (/lib64/libcairo.so.2) depends on a function called FT_Get_Var_Design_Coordinates. This function should come from FreeType. However, your version of libfreetype.so seems to be older and does not have this symbol. So, either you explicitly installed an older version, or "something" comes with an older version of FreeType.
I would look for files called libfreetype.so and check if they have the necessary symbol
I'm on Debian testing and here I get (this means that my version of FreeType does have this symbol; you would get no output if the symbol is not available):
$ nm -s -D /usr/lib/x86_64-linux-gnu/libfreetype.so | grep FT_Get_Var_Design_Coordinates
000000000001d260 T FT_Get_Var_Design_Coordinates
For you, based on the path to libcairo.so, I would expect something like /lib64/libfreetype.so to be the path to check.
I found a solution and I am going to share it with the community.
I am working on a Dell Latitude 3540 laptop running Linux CentOS 7 operating system (centos-release-7-3.1611.el7.centos.x86_64).
I ran sudo yum -y update and I understood there was a duplication issue regarding the freetype package, which was installed twice, and some other packages that were having conflicts.
I then removed the old freetype package and the conflicting packages with this command:
rpm -e freetype-2.4.11-12.el7.i686 --nodeps
rpm -e conflicting-package-1 --nodeps
rpm -e conflicting-package-2 --nodeps
...
Then I updated all the packages I manually removed:
sudo yum -y update freetype
sudo yum -y conflicting-package-1 freetype
sudo yum -y conflicting-package-2 freetype
...
This method worked out for me; I hope it might be helpful to someone.

Deleted /usr/bin/dotnet and pacman -S dotnet-sdk will not install it

I am trying to write a WEB api in dotnet core on my Manjaro Arch linux distro.
I installed the edge version of dotnet first (^3) since i like the bleeding edge. I had, however on a different computer already made the project using dotnet 2.2. Therefore i install dotnet 2.2 aswell. This did not work, since the version in /usr/bin/ was still 3.0.
I deleted the exec from /usr/bin and now i cant get it back. I have run pacman -Su and pacman -R, i have tried rebooting aswell.
OBS: the first to times i installed them, i did it with yay -S dotnet-sdk which allowed me to choose from the different versions
You can force install of packages that is already installed using --force in pacman.
So, you should be able to get the binary again by using sudo pacman -S dotnet-sdk --force.
You might also attempt to remove dotnet-sdk before you install, you can do that by running sudo pacman -Rns dotnet-sdk. (remove package with configurationfiles and dependencies not required by any other package).

upgrade r and rstudio on ubuntu 12.10 server using terminal

I have updated the sources.list file in /etc/apt with the link
deb https://cran.stat.nus.edu.sg/bin/linux/ubuntu precise/
I have changed precise with quantal, trusty also. I am staying in singapore so used the link from singapore. After
apt-get update
when I run
sudo apt-get install r-base
command i get the following error
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.2.2-1precise0) but it is not going to be installed Depends: r-recommended (= 3.2.2-1precise0) but it is not going to be installed Recommends: r-base-html but it is not going to be installed E: Unable to correct problems, you have held broken packages.
Why Precise aka 12.10? That is neither the current LTS (14.04) nor the previous one (12.04).
As such, it is supported neither by Ubuntu (AFAIK) nor the Michael who (as a volunteer) looks after the "ports" of my Debian packages to Ubuntu.
I generally stay current, so my machines are currently all 15.04 with some 15.10. I recommend you do the same.
As for RStudio, it is still not apt-get'able so that will always be a simple download (though you can script that).

Install R 3+ on Redhat 6.3

I want to install R on my Red hat cluster which has the version below:
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)
When I went to R's homepage and this is what in their repository:
I am wondering there is only redhat version 4 and 5 there and I don't know which version will best fit my operating system.
Texinfo Problem Goes Here
Since I have asked more than 6 questions today. Stackoverflow doesn't like me to ask more questions. So I will put the following questions into this question, sorry about that.
Hi, I was trying to use Expect to automatically log into a remote server and install R.
When I install R, they came up with all kinds of prompts asking 'The package will take xx MB Is that OK with you'?
The command to install:
su -c 'yum install R R-core R-core-devel R-devel'
You need to type in Yes for a few times to finish the installation.
My question is:
Is there a flag for yum install that you can tell the machine to install everything I want you to install. Don't ask me. So I can install those four packages without any prompt.
If that is hard to install in the 'quiet mode', how to write a while loop in Expect so it will send the Y automatically:
Pseudo Code Not Working!
send -- "sudo su -c yum install ...."
while ("Expect '*Is it OK [Y/N]*'"){
send 'Y\r'
# if (expect 'user$')
{break}
}
Thanks a lot in advance.
This is likely due to there being R RPMs in the Extra Packages for Enterprise Linux (EPEL) repos for RHEL6. You can find out more about EPEL on the Fedora website.
You need to configure yum to use EPEL. The easiest way to do this is to install the epel-release package for your platform, eg
su -c 'rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm'
or
su -c 'rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'
for example. The you can use yum to install R, e.g. you will probably want
su -c 'yum install R R-core R-core-devel R-devel'
so that you pull in the packages needed to build other add-on packages as most CRAN package are not in EPEL.
At the moment, the latest version of R in EPEL is 3.0.1, so one patch release point behind the latest version 3.0.2.

Resources