Problems installing R base - r

I keep getting this error when trying to install R
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.2.0-3trusty) but it is not going to be installed
Depends: r-recommended (= 3.2.0-3trusty) 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.
Any one knows how to solve this?

Try installing all at once
sudo apt-get install r-base r-base-core r-recommended r-base-html
but from your description is not clear how you manage to get into this situation in the first place. This should not happen under normal use.

Related

Completely remove R and its files in Linux mint

I was having trouble with R packages so I decided to uninstall to do fresh install. Now I cannot even re-install R. I am using Linux Mint. what I did is:
Removed all directories found with .libPaths()
And in the terminal:
sudo apt-get remove r-base-core
sudo apt-get remove r-base
sudo apt-get autoremove
Now when I try to install R following https://cran.r-project.org/ tutorial, I get many errors:
sudo apt update -qq
E: The repository 'https://cloud.r-project.org/bin/linux/ubuntu una-cran40/ Release' does not have a Release file.
apt install --no-install-recommends 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.6.3-2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
apt install r-recommended
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-recommended : Depends: r-cran-foreign (>= 0.7-2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
apt install r-cran-foreign
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-foreign : Depends: r-base-core (>= 4.0.0-1.2004.0) but 3.6.3-2 is to be installed
Depends: r-api-4.0 but it is not installable
E: Unable to correct problems, you have held broken packages.

Unable to install latest R version on Ubuntu 18.04 linux

I want to be able to install the latest stable R release for Ubuntu 18.04, I had the ubuntu version installed and so I removed it and then followed several guides like in this link.
No matter what I do I get the following output when I issue a sudo apt-get install r-base:
sudo apt 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.6.1-3disco) but it is not going to be installed
Depends: r-recommended (= 3.6.1-3disco) 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's wrong?

Problems installing R 3.5 on Ubuntu 16.04

Recently I had to update R from 3.4.4 to 3.5 for installing bioconductor packages. For doing that I followed the steps on this link.
But now I have the problem that r studio do not work for the problem:
R shared library (/usr/local/lib/R/lib/libR.so) not found. If this is
a custom build of R, was it built with the --enable-R-shlib option?
For that reason I tried to reinstall R 3.4.4 with the command:
sudo apt-get install r-base
But it returns me this error:
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.1-2xenial) but it is not
going to be installed
E: Unable to correct problems, you have held broken packages.
Does anyone know how to remove completely R (3.5) and installing again the 3.4 version?
Thank you all.
Edit: R works on command line with the 3.5 version and I cannot install other packages like:
$ sudo apt-get install libgdal-dev
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:
libgdal-dev : Depends: libarmadillo-dev but it is not going to be installed
Depends: libdap-dev but it is not going to be installed
Depends: libgeotiff-dev but it is not going to be installed
Depends: libgif-dev but it is not going to be installed
Depends: libhdf4-alt-dev but it is not going to be installed
Depends: libhdf5-dev but it is not going to be installed
Depends: libjpeg-dev
Depends: libmysqlclient-dev but it is not going to be installed
Depends: libnetcdf-dev but it is not going to be installed
Depends: libpoppler-private-dev but it is not going to be installed
Depends: libpq-dev but it is not going to be installed
Depends: libtiff-dev
Depends: libxml2-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

How to install R on ubuntu 16.10 via the terminal?

I'm trying to install R from the terminal following this site:
https://www.r-bloggers.com/how-to-install-r-on-linux-ubuntu-16-04-xenial-xerus/
When I execute sudo apt-get install r-base, I get the following error:
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.3.2-1xenial0) but it is not going to be installed
Depends: r-recommended (= 3.3.2-1xenial0) 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.
Add the two others to the command, and see the errors it generates, ie do
sudo apt-get install r-base r-base-core r-recommended
You likely you have something installed which conflicts. Many (and I mean thousands) of us run these packages just fine.
You can also consider the r-sig-debian mailing list.

Installing R in ubuntu

I am trying to install R in ubuntu, but faced the following error:
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.0.0-2lucid) but it is not going to be installed
Depends: r-recommended (= 3.0.0-2lucid) 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.
Before doing this, I also added this line to /etc/apt/sources.list
# added from cran.cnr.berkley.edu for R
deb http://cran.cnr.berkeley.edu/bin/linux/ubuntu lucid/
But when I tried to update, I received an authentication error:
...
Reading package lists... Done
W: GPG error: http://cran.cnr.berkeley.edu lucid/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
Any idea how to solve this issue?
I also did the instructions for SECURE APT, but still I get the following dependency error:
The following packages have unmet dependencies:
r-base-dev : Depends: r-base-core (>= 3.0.1-3lucid) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
But then I used a different mirror (by changing /etc/apt/sources.list) it worked:
deb http://cran.mtu.edu/bin/linux/ubuntu precise/

Resources