简体   繁体   中英

Unable to Install R base in Ubuntu 16.04

I know this was already asked before but none of the answers I tried worked for me. I need to install R but every time I try this error comes up:

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.4.1-2xenial0) but it is not going to be installed
          Depends: r-recommended (= 3.4.1-2xenial0) 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.

To other errors that I encountered, I used the ff and solved them:

gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -

sudo add-apt-repository ppa:marutter/rrutter 
sudo apt-get update 
sudo apt-get upgrade 

However the first error still shows up. Any idea how to solve this? Please.

@neilfws comment was the only thing that helped . I followed his link . And I used this answer (the most upvoted one as of now).

So what I did,

sudo apt-get install aptitude

sudo aptitude install r-base

This first gave me an option to accept but somehow still had some dependencies unresolved, so I rejected the first suggestion and accepted the next one that "sounded reasonable"

     Keep the following packages at their current version:
1)     r-base [Not Installed]                             
2)     r-cran-foreign [Not Installed]                     
3)     r-recommended [Not Installed]                      

     Leave the following dependencies unresolved:         
4)     r-base-core recommends r-recommended               


Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Install the following packages:            
1)     r-cran-foreign [0.8.69-1xenial0 (xenial)]
Accept this solution? [Y/n/q/?] Y

I have documented the whole re-installation here .

Background

I installed R3.5 on my Ubuntu 16.04, after installing the package XLSX following various resources as documented here , I thought I have problems with other packages (I was wrong), which is when I decided to reinstall. I started with purging all the installations but nothing was enough and I got a similar error as that of the OP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM