0

i tried to install R on Ubuntu20.04 focal. but i got error "unmet dependencies".

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 (>= 4.0.3-1.2004.0) but it is not going to be installed
          Depends: r-recommended (= 4.0.3-1.2004.0) but it is not going to be installed
          Recommends: r-base-html but it is not going to be installed
          Recommends: r-doc-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

i did following things

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'

but those did not work.

release info

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS"
enter code here

please help me to install R.

kazuki
  • 21
  • 3
  • Do `sudo apt update; sudo apt upgrade` to install the package along with its dependencies. – Dirk Eddelbuettel Jan 29 '21 at 02:59
  • i did `sudo apt update` and `sudo apt upgrade` but nothing changed. get same error when i do `sudo apt install r-base` – kazuki Jan 29 '21 at 03:44
  • 1
    You are not sharing the full errors, maybe expand your question. Also, when I have such errors where `r-base` implies the two packages listed in the output I force all three: `sudo apt install r-base r-base-core r-recommended`. Try that, analyse what errors you get. – Dirk Eddelbuettel Jan 29 '21 at 03:53
  • Did you follow [these](https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-20-04) instructions? They work as I just tested them. – Marcin Jan 29 '21 at 04:03

1 Answers1

1

Finally i found that the cause of issue is setting wrong source list.

$ apt list | grep r-base
r-base/focal 4.0.3-1.2004.0 all

$ apt show r-base/focal
Package: r-base
Version: 4.0.3-1.2004.0
Priority: optional
Section: gnu-r
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Installed-Size: 63.5 kB
Depends: r-base-core (>= 4.0.3-1.2004.0), r-recommended (= 4.0.3-1.2004.0)
Recommends: r-base-html, r-doc-html
Suggests: elpa-ess, r-doc-info | r-doc-pdf
Download-Size: 43.6 kB
APT-Sources: http://ppa.launchpad.net/marutter/rrutter4.0/ubuntu focal/main arm64 Packages

this is wrong source. APT-Sources: http://ppa.launchpad.net/marutter/rrutter4.0/ubuntu aws source list already had source list for r3.6. so, i decided to remove it.

$ cd /etc/apt/sources.list.d
$ rm marutter-ubuntu-rrutter4_0-focal.list
$ rm marutter-ubuntu-rrutter4_0-focal.list.save

$ apt update
$ apt list | grep r-base
 r-base-core-dbg/focal 3.6.3-2 arm64
 r-base-core/focal,now 3.6.3-2 arm64 [residual-config]
 r-base-dev/focal 3.6.3-2 all
 r-base-html/focal 3.6.3-2 all
 r-base/focal 3.6.3-2 all

$ apt install r-base

now i successfully installed R.

kazuki
  • 21
  • 3