kazuki
kazuki

Reputation: 71

failed to install R in Ubuntu 20.04 focal

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.

Upvotes: 0

Views: 1122

Answers (1)

kazuki
kazuki

Reputation: 71

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 <[email protected]>
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.

Upvotes: 1

Related Questions