I am trying to update to R version 3.5.3, by using the R manual. However, when I type this line:
deb https://cloud.r-project.org/bin/linux/ubuntu cosmic-cran35/
I get a return of command not found.
I tried to add it to my source list as previously suggested, but this does not seem to work. I am trying to do this on a linux system
Edit: Thanks #Ralf for correction (see comments)
Append the 'deb' line to your sources.list by opening a terminal and typing:
echo "deb https://cloud.r-project.org/bin/linux/ubuntu cosmic-cran35/" | sudo tee -a /etc/apt/sources.list
Install the R-CRAN GPG key to verify what you're installing:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Update your package list and install with:
sudo apt update
sudo apt install r-base r-base-dev
Related
I am unable to install the R package ggplot2 because it depends on the package digest, which requires R (>= 3.3.0) and I only have 3.2.3. I tried upgrading R as described here, but I get an unusual message after the first line and an error after the third. The results of the first 3 lines are below exactly as the appear on the command terminal, edited for privacy and empty lines before commands added for clarity.
Name1#Name2 ~ $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
[sudo] password for Name1:
Executing: /tmp/tmp.BIQ28xf0ql/gpg.1.sh --keyserver
keyserver.ubuntu.com
--recv-keys
E298A3A825C0D65DFD57CBB651716619E084DAB9
gpg: requesting key E084DAB9 from hkp server keyserver.ubuntu.com
gpg: key E084DAB9: "Michael Rutter <marutter#gmail.com>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
Name1#Name2 ~ $ sudo echo "deb http://cran.wustl.edu/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list
deb http://cran.wustl.edu/bin/linux/ubuntu xenial/
Name1#Name2 ~ $ sudo apt update
E: Malformed entry 2 in list file /etc/apt/sources.list (Suite)
E: The list of sources could not be read.
All commands after the third give the same errors, with commands 4 and 6 giving the errors twice for some reason.
I will be frank and admit that this whole think is very beyond me and I am just copying and pasting the code that supplied without understanding most of it. Any help will be greatly appreciated.
EDIT: Answer available here.
You are almost there, but it seems like your sources.list may be malformed.
First delete all entries related to R by using nano /etc/apt/sources.list (or your favorite editor).
Then as you did add the key
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Then add the correct repository
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
Quick update
sudo apt update
Install r-base by
sudo apt-get install r-base
And confirm everything is working with
R --version
If I run this
sudo apt-get install r-base
R 3.4 is installed from the ubuntu repo. So I added the CRAN repositories by doing
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu eoan-cran35/'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt update
sudo apt install r-base
but then I get
The following packages have unmet dependencies:
r-base: Depends: r-base-core (> = 3.6.3-1eoan) but 3.4.4-1ubuntu1 is going to be installed
Depends: r-recommended (= 3.6.3-1eoan) but 3.4.4-1ubuntu1 is going to be installed
E: Problems cannot be corrected, you have retained broken packages.
I swear I tried every line of code from every forum I found but nothing solved this issue. I tried:
sudo apt update && sudo apt-get autoclean && sudo apt-get clean && sudo apt-get autoremove
sudo apt install --fix-broken
sudo apt-get install -f
sudo apt dist-upgrade -y
sudo apt full-upgrade
I also tried disabling ubuntu repos and use only the CRAN repositories, but it doesnt work.
I tried installing r-base 3.4 and upgrading from that but nothing.
I really don't know what else to do, any ideas?
It depend of the version of Linux Mint you are running, but based on your code, you are trying to install r-base for Ubuntu 19.10 eoan (which is not a LTS).
The last version of Linux Mint 19.3 is based on Ubuntu 18.04 Bionic, so you should edit your /etc/apt/sources.list file and add
deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
Then:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base-dev
All informations from cran are here: https://cran.r-project.org/
For Linux Mint, check this page (https://www.linuxmint.com/rel_tricia_xfce_whatsnew.php):
> Linux Mint 19.3 features Xfce 4.14, a Linux kernel 5.0 and an Ubuntu 18.04 package base.
I am trying to update R in my Ubuntu Xenial machine. When I run:
R --version
the output is
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
I have been checking a lot of post about how to do it. My main steps have been:
Open the source list and add the link
sudo nano /etc/apt/sources.list
deb http://cran.rstudio.com/bin/linux/ubuntu xenial/
(Maybe I am adding the link in the wrong place of the source.list? I don't know, I am new in Ubuntu). After adding the link, I save and exit the source.list. Then my steps have been:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base
Once the process is finished, I run again:
R --version
And the output is still
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
I don't have a lot of experience with Linux yet but based on previous post and their solutions I cannot manage to solve the problem.
By the way, I need to update R since some of the packages I need to use (such as rgdal) are not available under the version I currently have
Thanks for the help
M
See this, as you are already doing you have to use the distribution from CRAN:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update
sudo apt-get install r-base
The CRAN README probably is the right place to read first.
What you have it pretty good. I would make it
a) use a file, say cran.list inside of /etc/apt/sources.list.d/
b) use https://, ie I have deb https://cloud.r-project.org/bin/linux/ubuntu zesty/ (and that actually points to the same CDN servers as what you have)
c) run apt-get update and then check via apt-cache policy r-base-core
It should show both the newer (at CRAN) and older (from Ubuntu):
edd#bud:~$ apt-cache policy r-base-core
r-base-core:
Installed: 3.4.3-1zesty0
Candidate: 3.4.3-1zesty0
Version table:
*** 3.4.3-1zesty0 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
100 /var/lib/dpkg/status
3.4.2-2zesty 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.2-1zesty1 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.1-2zesty0 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.1-1zesty0 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.0-1zesty 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.3.2-1 500
500 http://us.archive.ubuntu.com/ubuntu zesty/universe amd64 Packages
edd#bud:~$
The three stars show that that is the installed version.
d) Now when you see the desired version available, install the usual way via apt-get install r-base-core. You should get the highest version as expected.
I am trying to install the latest version of R (3.4.0) due to some incompatibility issues with dowloading of a package called "Slam". I have downloaded the tar.gz file of 3.4.0 but there are some issues with the make file for installation.
I have uninstalled the r-base of 3.2.3. Now when I'm installing R again, I get the same version instead of the upgrade version. I even ran the sudo apt-get update command but in vain.
you need to install from the CRAN repos not the ubuntu ones. add the key, then the repository, update and the apt-get
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update
sudo apt-get install r-base
I'm creating a docker container and I'm installing R in it.
The problem is, that when running R in the container, the main R process create ncores - 1 subprocesses.
So when running the docker on my laptop with 8 cores, I get 1 R process and 7 R subprocesses.
I also tried to configure my Docker file similar to this:
https://github.com/rocker-org/rocker/blob/eeb9c8a5f416f7cfe982734440e39fa72abbcb33/r-base/Dockerfile
but is still not working.
Docker-file:
FROM ubuntu:14.04
RUN sed -e 's/archive\.ubuntu/at\.archive\.ubuntu/g' -i /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y install libatlas3-base
RUN apt-get -y install libopenblas-base
RUN apt-get -y install r-base
RUN apt-get -y install r-base-dev
RUN apt-get -y install apt-utils
RUN echo "deb http://cran.cnr.berkeley.edu/bin/linux/ubuntu/ trusty/" >> /etc/apt/sources.list
RUN gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
RUN gpg -a --export E084DAB9 | apt-key add -
RUN apt-get update
RUN apt-get -y --with-new-pkgs upgrade
Did someone encountered this problem?
I don't know why, but the whole problem was caused by installing libopenblas-base.
After removing the line
RUN apt-get -y install libopenblas-base
everything worked fine!