Unable to install R 4.0 on Linux Mint 19.1 Tessa - r

I have been trying for days now. I would like to upgrade to the latest version of R. I have followed advice found on this link :
Problem installing R4.0 on LInux Mint 19.3
but for me the problem persists for me.
When I do
echo -e "\ndeb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/" | sudo tee -a /etc/apt/sources.list
then
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt-get install r-base
I get this
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 (= 4.0.5-1.1804.0) but it is not going to be installed
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:7
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:7
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:7
E: Unable to correct problems, you have held broken packages.
If anyone has an idea of how to solve this I would be eternally grateful.

W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:7
Remove the duplicate entry in your sources (line 5 and 7):
sudo sed -i '7d' /etc/apt/sources.list
The following packages have unmet dependencies:
r-base : Depends: r-recommended (= 4.0.5-1.1804.0) but it is not going to be installed
Use the following command:
sudo apt update
sudo apt install --no-install-recommends r-base

This post:
https://unix.stackexchange.com/a/612316/367012
Says Mint is different than Ubuntu in adding repositories, and suggests manually editing the repository list,
$ sudo xed /etc/apt/sources.list.d/additional-repositories.list
to add:
deb cloud.r-project.org/bin/linux/ubuntu bionic-cran40/
Save and exit the editor, then update the package list:
$ sudo apt update
This post: https://askubuntu.com/a/1113944/968912 suggests removing all the previous versions of R first.

Related

Having difficulty with re-installing R in Ubuntu 18.04

Very recently I shifted to Ubuntu from Windows and downloaded R-base (3.4.4) and R studio. However, some packages (car, ROCR etc) were not available and hence I tried to update R. Because of error messages, I finally tried to uninstall and remove R and then install it again.
I tried
sudo apt-get upgrade
sudo apt install r-base
However, it is showing me error message like,
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-recommended (= 3.6.2.20200221-1~ubuntu18.04.1~ppa1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
So basically right now, I have no R-base installed.
I tried to remove R-base.
sudo apt-get remove r-base
And all I am getting is-
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'r-base' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I am a beginner in both R and Linux. I need your valuable suggestions.
Thanks in advance.
If you are using Ubuntu 18.04, please follow these steps if you are using your local machine of your own. (If your are working in any office environment please setup proxy and follow these steps)
1) Let’s first add the relevant GPG key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
2) Add the R Repository
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'
3) Update Package Lists
sudo apt update
4) Install R
sudo apt install r-base
5) Test Install
sudo -i R
6) Installing R Packages from CRAN
install.packages('dplyr')

How do I solve a dependency error that prevents me from installing R 4.0 on Ubuntu 18.04?

I'm trying to install R 4.0 on Ubuntu, but get this error:
$ 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 (>= 4.0.0-1.2004.0) but it is not going to be installed
Depends: r-recommended (= 4.0.0-1.2004.0) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I have run these commands to set up apt to receive R 4.0, as recommended at https://cran.r-project.org/bin/linux/ubuntu/README.html:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
sudo apt-get update
What am I doing wrong, and how can I fix it?
I did have R 3.4 installed on this system before, and removed it with
sudo apt-get remove r-*
sudo apt-get purge r-*
Have I screwed something up by doing that?
The error was, it turned out, entirely mine:
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
added the repo for Ubuntu 20.04. I needed:
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'

Update R in ubuntu

I'm having some problems to update my R in my ubuntu. When I try I get this message:
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 (>= 4.0.0-1.1804.0) but 3.6.3-1eoan is to be installed
Depends: r-recommended (= 4.0.0-1.1804.0) but 3.6.3-1eoan is to be installed
E: Unable to correct problems, you have held broken packages.
When I ran: apt policy r-base i've got this message:
apt policy r-base
r-base:
Installed: 3.6.3-1eoan
Candidate: 4.0.0-1.1804.0
Version table:
4.0.0-1.1804.0 500
500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
*** 3.6.3-1eoan 100
100 /var/lib/dpkg/status
3.6.1-4 500
500 http://br.archive.ubuntu.com/ubuntu eoan/universe amd64 Packages
500 http://br.archive.ubuntu.com/ubuntu eoan/universe i386 Packages
I've already changed my source list puting this inside:
https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/
Does anyone know what do I do to resolve this problem?
Browse to /etc/apt/sources.list and check if you have added the correct repo.
Remove any old CRAN mirror like bionic-cran35.
If you haven't properly added the current CRAN mirror, run these commands:
(you can confirm the GPG key here: https://cran.r-project.org/bin/linux/ubuntu/README.html):
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/"
Then fix remaining problems and update (which might already solve the issue):
sudo apt --fix-broken install
sudo apt autoremove
sudo apt update
sudo apt upgrade
Remove current version of r and dependencies:
sudo apt remove r-base-core
sudo apt remove r-recommended
sudo apt remove r-base
Install the newest r-base:
sudo apt install r-base
To check your success, run this code:
R
version

Can't install r-base on Ubuntu 19.10; unmet dependencies r-recommended

In general, I am new in working with Ubuntu (19.10;eoan) and currently trying to install r-base. r-base-dev is installed.
When I do so, I get the following message:
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.6.2-1xenial) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I have used the following Threads to try to fix my problem - without any succes.
Installing r-base; Depenency: r-recommended missing?
Issues in installing r-base-dev
For this one I stopped at the section: "Disable/Remove/Purge PPA:". Because I was not able to understand the process.
https://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies-after-adding-a-ppa
I will appreciate any solution or advice to solve my problem.
Without more information about what you actually tried (and the order) it is difficult to try and pinpoint why it doesn't work, but I recently installed this on 19.10 myself. I used the following.
# Get the key from the keyserver.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
# Add the repository to your sources.list. Make sure that it does not already exist
# and that it is not a typo in there. Making a backup of the file before running the
# next line is useful.
echo "deb https://cloud.r-project.org/bin/linux/ubuntu eoan-cran35/" | sudo tee -a /etc/apt/sources.list
# Install base, dev and other dependencies.
sudo apt install r-base r-base-dev r-cran-curl r-cran-openssl r-cran-xml2 libssl-dev libxml2-dev libcurl4-openssl-dev
It worked without any problem for me. It is very important that you add the correct repository to your sources.list. Judging by the error message you are using a repository referring to Ubuntu Xenial and not Ubuntu Eoan.

readr package not installing on Ubuntu

Hello I am trying to install reader onto my Ubuntu VPS. I only have 1 GB of RAM which is why I can not install it. I came across Dirk's post R (Ubuntu) - Can't install packages "readr" and "eurostat" where he explained the work around.
apt-get update # refresh
apt-get install software-properties-common
add-apt-repository -y "ppa:marutter/rrutter"
add-apt-repository -y "ppa:marutter/c2d4u"
apt-get update # now with new repos
apt-get install r-cran-readr
However, when I run the code. The final line gives me this error:
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-cran-readr : Depends: r-api-3.4
Depends: r-cran-rcpp but it is not going to be installed
Depends: r-cran-tibble but it is not going to be installed
Depends: r-cran-hms but it is not going to be installed
Depends: r-cran-r6 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I was able to install all the packages separately and tried running the code again. I got the same error. I am not to sure what my next steps should be.
Edit**
I am trying to follow Dirk's advice in the comment section. I am having a difficult time understanding what to do with the "deb" file. Once I have the deb link
deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
Some sources to me to run the command
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
However, I recieve this error.
keyserver receive failed: No dirmngr
It seems like I have to add the deb link to a directory. I am brand new to Ubuntu and the shell. If someone could explain this to me in simple terms that would be greatly appreciated.

Resources