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
  • 5
  • 14

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
  • 62,253
  • 1
    Thanks a lot. I will never do those again. I followed the steps.Still there is a dependency issue.here it is.

    The following information may help to resolve the situation:

    The following packages have unmet dependencies: r-base : Depends: r-recommended (= 3.4.2-2zesty) but it is not going to be installed

    E: Unable to correct problems, you have held broken packages.

    – Md. Mahim Anjum Haque Nov 01 '17 at 03:22
  • @MahimAnzumHaquepantho you must uninstall the older version of the package. You have something the depends upon it, or it would have been autoremoved, so be prepared for multiple packages to get removed - read the proposed list, and write down anything important so you remember what you must reinstall after all conflicting packages are removed. – user535733 Nov 01 '17 at 14:30
  • i do not have any older version of that package, never installed it before. and first there were 2 dependency issues but just one. The following packages have unmet dependencies: r-base : Depends: r-recommended (= 3.4.2-2zesty) but it is not going to be installed E:
    Unable to correct problems, you have held broken packages.
    – Md. Mahim Anjum Haque Nov 01 '17 at 15:05
  • Reading package lists... 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.4.2-2zesty) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

    – Md. Mahim Anjum Haque Nov 01 '17 at 15:07
  • The AskUbuntu format is poorly suited to this kind of back-and-forth, which won't help anybody else in the future. I gently suggest you take the current problem over to Ubuntuforums.org, which has the tools and the format for the more interactive assistance you need. – user535733 Nov 01 '17 at 15:31
  • https://ubuntuforums.org/showthread.php?t=2376307&p=13706126#post13706126 – Md. Mahim Anjum Haque Nov 01 '17 at 16:11
  • please checkout the link – Md. Mahim Anjum Haque Nov 01 '17 at 16:11