How to install newer R-packages on Debian Jessie (8.8)? - r

On Debian Jessie (8.8), the most up-to-date R package isn't enough for using some Jupyter-notebook functions (like rpy2), so I am trying to get R>=3.3 version. The current version is:
R version 3.1.1 (2014-07-10)
Here is an useful link provided by a stackoverflow user: https://cran.r-project.org/bin/linux/debian/, but even with it, I don't know how to get the newer R-version.
Would you help me please?
EDIT
Not sure if helps, but here is what I have in /etc/apt/sources.list
# deb cdrom:[Debian GNU/Linux 8 _Jessie_ - Official Snapshot amd64 LIVE/INSTALL Binary 20160315-14:54]/ jessie contrib main non-free
## Repositorio oficial de Debian GNU/Linux
deb http://ftp.debian.org/debian/ jessie main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
~

You can upgrade r package from :
1) Backports repository : (the 3.3.3 version)
Add the following line to your sources.list:
deb http://deb.debian.org/debian jessie-backports main contrib non-free
Save then install r:
apt-get update
apt-get -t jessie-backports install r-base r-base-dev
2) CRAN repository (the 3.4.3 version)
Follow the steps described on the official documentation :
For a backport of R 3.4.3 to jessie, please add something like
deb http://<favourite-cran-mirror>/bin/linux/debian jessie-cran34/
to the file /etc/apt/sources.list on your computer. You need to substitute <favourite-cran-mirror> by one of the mirror URLs listed in the mirror list.
Secure APT
Before installing the package from CRAN repository , You need to import the singing key released by Johannes Ranke <jranke#uni-bremen.de> (see the secure-apt )
e,g:.
echo deb https://mirrors.sorengard.com/cran/bin/ldebian jessie-cran34/ >> /etc/apt/sources.list
apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
apt-get update
apt-get install r-base r-base-dev

Related

Update R base - Ubuntu from 3.4.4 to 3.5.2 - Azure

I'm using Ubuntu 16.04 on Azure Linux Virtual Machine
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
The current R version for Rstudio/Rserver is 3.4.4 and I would like to update it to the latest version (i.e. version 3.5.2)
R --version
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
From some reasons, the most common method doesn't work:
apt-get update
apt-get upgrade
So I did some research and find this post on biostars.org
One of the posts says the following codes might work
sudo su
echo "deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/" >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
apt-get update
apt-get install r-base
apt-get install r-base-dev
However, after apt-get install r-base I'm getting the following error message:
root#VMforR:/usr/local/bin# apt-get install r-base
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-recommended (= 3.5.2-1xenial) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I don't understand what "held broken packages" means, and more importantly, how to update the R base?
What worked for me was to add the PPA of Michael Rutter:
sudo add-apt-repository ppa:marutter/rrutter3.5
sudo apt-get update
Update R:
sudo apt install r-api-3.5
I'm with the 16.04 LTS ubuntu.
Have tried some other methods, the following seems to work:
sudo apt-get install r-base-core=3.5.2-1xenial
Ref:
1. Install particular version(2.15.2) of r-base on ubuntu
2. https://cran.rstudio.com/bin/linux/ubuntu/xenial-cran35/
But I'm not sure if this also work for others or not, as I can't reproduce it.
After
apt-get update
do
apt-get dist-upgrade
first to "move your installation forward". That includes upgrading already installed packages. It should just upgrade your R installation (unless you also switch / need to switch repositories).
The r-sig-debian list is good and patient with basic 'how do it od X for R on Debian/Ubuntu'. Consider subscribing to lurk and/or ask questions.
Mine said some of my packages were missing. So, I ran sudo dpkg --configure -a and then re-run the R --update and it worked to correct the missing package error.

How to upgrade R version on WSL?

I'm running Ubuntu in Windows Subsystem for Linux, and apt-get update isn't finding the newest versions of r-base. On Ubuntu 16.04, the newest R version it gets is 3.2.3. How do I upgrade to newer versions of R?
It turns out that the version of r-base in the default Ubuntu repository is behind the newest version of r-base from CRAN.
The solution is to add R-CRAN to /etc/apt/sources.list, using the instructions here: https://cran.r-project.org/bin/linux/ubuntu/
sudo sh -c 'echo "deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/" >> /etc/apt/sources.list'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt-get update
sudo apt-get install --only-upgrade r-base # This upgrades r-base if it's already installed; otherwise it doesn't install it
As #DirkEddelbuettel said in his comments, this README has helpful information for how you can update your R version in a Windows subsystem for Linux (WSL) setting. For me, I updated from R 3.4 to R 4.0 on Ubuntu 18.04.
I am running bionic (I used lsb_release -a to find out), and I wanted R 4.0 so I picked the appropriate deb line (for me: deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/) to add to my /etc/apt/sources.list file (had to use sudo vim /etc/apt/sources.list to add this line to the end). Then I ran sudo apt-get update and sudo apt-get install r-base. Now I have 4.0.2, the newest version. Just pick the particular Ubuntu/R combo that you want based on the options from the README. I hope this can help someone.

RCurl Installation in R 3.1.1: package 'RCurl' is not available (for R version 3.1.1)?

It says in Cran that RCurl should be for R >3.0.0 but R 3.1.1 in Debian Jessie fires the error:
package 'RCurl' is not available (for R version 3)
the same problem with rjson. The dependencies are libcurl and make that are installed. What is the problem with R 3.1.1 in installing the libcurl packages such as RCurl? How to overcome this the most convenient way?
P.s. I know this thread but any method did not solve this issue.
Apt-get install the 3.1.1 R version by default, for example in Debian Jessie. We can either install the newest version of R with the newest RCurl or install the archived version of RCurl working in R 3.1.1.
Solution A
You can install the newest version, source, such that
sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/debian jessie-cran3/" >> /etc/apt/sources.list'
sudo apt-key adv --keyserver subkeys.pgp.net --recv-key 381BA480
sudo apt-get update
sudo apt-get install r-base r-base-dev
and now you can install RCurl in R, working in R 3.3.2.
Solution B
Install the Curl from the CRAN Archieves matching the 3.1.1 R, apparently this here as suggested by Imo in the comment.

Receiving "Unmet dependency" while installing r-base on Ubuntu 14.10

I am trying to install R on Ubuntu 14.10
When I am giving the command to download r-base, I get the following error
roy#laptop:~$ sudo apt-get install r-base
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.1.2-1precise0) but it is not going to be installed
Depends: r-recommended (= 3.1.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.
What can I do? I found adding backports of raring could help. I tried several servers, but I'm getting a 404.
Here are the following changes I brought in /etc/apt/sources.list
## R
deb http://cran.cnr.Berkeley.edu/bin/linux/ubuntu precise/
## Raring backports
deb http://us.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
Step 1:
You can use any of the below in your /etc/apt/sources.list file to get the latest copy of R, replace <my.favorite.cran.mirror> by the actual URL of your favorite CRAN mirror. See http://cran.r-project.org/mirrors.html for the list of CRAN mirrors.
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu utopic/
or
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu trusty/
or
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu precise/
or
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu lucid/
Step 2:
To install the complete R system, use below on command line:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo add-apt-repository ppa:marutter/rdev
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base
For a detailed instruction, please follow the steps given in the link here!

Install particular version(2.15.2) of r-base on ubuntu

I am newbie to both Ubuntu and R.
I am trying to install R 2.15.2 on ubuntu. Since the latest version of R is 3.0.X, I specified the version in /etc/apt/sources.list
deb http://cran.ma.imperial.ac.uk/bin/linux/ubuntu precise 2.15.2
Then I ran sudo apt-get install r-base.
It installs, but when I check version, it is 2.14.1, not 2.15.2
I tried to specify version in command line, such as:
sudo apt-get install r-base_2.15.2_1precision1
Always seeing:
E: Unable to locate package r-base_2.15.2_1precision1.
E: Couldn't find any package by regex 'r-base_2.15.2_1precision1'
Any suggestion? Thanks.
If I run command:
sudo apt-get install r-base=2.15.2-1precise0
See the following message:
The following packages have unmet dependencies:
r-base : Depends: r-recommended (= 2.15.2-1precise0) but 3.0.1-1precise0precise2 is to be installed
Recommends: r-base-html but it is not going to be installed
Find the solution.
I need to install like:
sudo apt-get install r-base-core=2.15.3-1precise0precise1
sudo apt-get install r-recommended=2.15.3-1precise0precise1
sudo apt-get install r-doc-html=2.15.3-1precise0precise1
sudo apt-get install r-base=2.15.3-1precise0precise1
Okay so the URL for where the packages are found has changed :^) on the cran.ma site:
Change the debian url to:
deb http://cran.ma.imperial.ac.uk/bin/linux/ubuntu precise/
do an apt-get update and try reinstalling
The complete instructions are on:
http://cran.ma.imperial.ac.uk/bin/linux/ubuntu/

Resources