1

While installing R in a newly updated Ubuntu 17.10 the following dependency error occurred. How to resolve them?

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.4.2-2xenial2) but it is not going 
to be installed
Depends: r-recommended (= 3.4.2-2xenial2) but it is not going   
to be installed
      Recommends: r-base-html but it is not going to be installed
THelper
  • 355

1 Answers1

4
  1. First, you get The Lecture:

    Never get your support from random blog posts. Bad advice can destroy your system. Ask here first - that's why we are here.

    Never run a script that you downloaded from the internet unless you have fully audited it and completely understand everything it does. How do you know that script wasn't poisoned with malware?

    Never install software from non-Ubuntu sources until you have the skill to remove it. Never install random software from random sites on the dirty, dirty internet.

  2. Clean up the mess you made with that awful script:

    sudo apt-mark auto gdebi libxml2-dev libssl-dev libcurl4-openssl-dev libopenblas-dev r-base r-base-delibopenblas-dev python-pip markdown
    sudo apt remove --purge r-base rstudio-xenial
    sudo apt autoremove
    

    Do not run any of those commands until you understand exactly what each does.

    The first line undoes a lot of bloat that the script dragged in, by making those packages eligible for autoremoval.

    The second line removes the key packages, also enabling many lower-level packages for autoremoval.

    The third line removes any orphaned or unused packages. There should be a few.

  3. Test your package manager for proper function:

    sudo apt update
    sudo apt upgrade
    

    You should get no errors.

  4. Remove the source that provides the conflicting packages.

    Happily, this is not a problem you have. The script did not install any sources (that was one of it's problems!)

  5. Install R from the Ubuntu repositories:

    sudo apt install r-base
    

    For updated versions of R, see How do install package of R language's interpreter for statistical computing?

user535733
  • 68,493