I was following this instruction for installing R 4.0 in Ubuntu 18.04
$ sudo apt remove r-base $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 $ sudo add-apt-repository 'deb bionic-cran40/' $ sudo apt update $ sudo apt install r-base However I get this error message:
Reading package lists... Done Building dependency tree Reading state information... Done Package r-base is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: r-base-core r-doc-info r-doc-html r-base-html r-base-core:i386 E: Package 'r-base' has no installation candidate I'm using this version of Ubuntu:
$ uname -a Linux ip-172-31-28-209 5.4.0-1059-aws #62~18.04.1-Ubuntu SMP Fri Oct 22 21:51:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux $ lsb_release -cs bionic How can I resolve the issue?
Update
$ sudo apt-cache policy r-base r-base: Installed: (none) Candidate: (none) Version table: 4.1.2-1.1804.0 -1 -1 bionic-cran40/ Packages 4.1.1-1.1804.0 -1 -1 bionic-cran40/ Packages 4.1.0-1.1804.0 -1 -1 bionic-cran40/ Packages 4.0.5-1.1804.0 -1 -1 bionic-cran40/ Packages 4.0.4-1.1804.0 -1 -1 bionic-cran40/ Packages 4.0.3-1.1804.0 -1 -1 bionic-cran40/ Packages 4.0.2-1.1804.0 -1 -1 bionic-cran40/ Packages 4.0.1-1.1804.0 -1 -1 bionic-cran40/ Packages 4.0.0-1.1804.0 -1 -1 bionic-cran40/ Packages 3.4.4-1ubuntu1 -1 -1 bionic/universe amd64 Packages Update 2
$ sudo apt install r-base=4.1.2-1.1804.0 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.1.2-1.1804.0) but it is not installable Depends: r-recommended (= 4.1.2-1.1804.0) but it is not installable Recommends: r-base-html but it is not installable Recommends: r-doc-html but it is not installable E: Unable to correct problems, you have held broken packages. 63 Answers
Following suggestion by @user.dz, I ended up manually editing /etc/apt/preferences and replacing pin priority from -1 to 500
Package: * Pin: release a=bionic* Pin-Priority: 500 0The Problem is :
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). Executing: /tmp/apt-key-gpghome.D7jTjWc4gW/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 gpg: key 51716619E084DAB9: "Michael Rutter <>" 1 new signature gpg: Total number processed: 1 gpg: new signatures: 1
When you run apt-key the keyserver is deprecated on /tmp/ like my case. The Ubuntu archives on CRAN are signed with the key of Michael Rutter with key ID 0x51716619e084dab9. To add the key to your system with one command use
Recommended method :
$ wget -qO- | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc $ sudo add-apt-repository "deb $(lsb_release -cs)-cran40/" $ sudo apt update $ sudo apt install --no-install-recommends r-base Hope this helps.
Related
3Given you get the message:
However the following packages replace it: r-base-core r-doc-info r-doc-html r-base-html r-base-core:i386 I am going to say perhaps r-base-core.