Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 623
dobis32 Avatar asked Aug 29 '18 22:08

dobis32


People also ask

How do I manually download an R package?

Go into R, click on Packages (at the top of the R console), then click on "Install package(s) from local zip files", then find the zip file with arm from wherever you just saved it. Do the same thing to install each of the other packages you want to install.

What version of R do I need to install?

On all platforms you need to install a version of R to target development against; you should install R before running any dependency installation scripts in RStudio. RStudio itself is compatible with R version 3.0.1 or later, but version 3.1 or greater is recommended for development installations.

Why is the R-base package not available?

Done Package r-base is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: r-base-core r-doc-info r-doc-html r-base-html r-base-core:i386 E: Package 'r-base' has no installation candidate

What are some packages that have unmet dependencies?

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?

How do I install RStudio Server on Linux?

On Linux all dependencies for RStudio Server can be installed installed using the scripts in: There is a separate script for systems with debian, yum, or zypper based package management. For example, to install dependencies for debian systems:


3 Answers

Running the following commands seems to have solved my problem:

sudo apt --fix-broken install
sudo apt-get update
sudo apt-get upgrade
like image 91
dobis32 Avatar answered Nov 05 '22 10:11

dobis32


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.

like image 30
Weevils Avatar answered Nov 05 '22 09:11

Weevils


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

like image 45
Gopal Vashishtha Avatar answered Nov 05 '22 09:11

Gopal Vashishtha