I use 18.04.4 LTS (Bionic Beaver)
I wanted to upgrade my R version from 3.4.4 to 3.6.2, but now I have no R at all.
here are my actions:
1 step:
sudo apt update
sudo apt-get upgrade
sudo apt-get dist-upgrade
2 step:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
3 step:
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
return:
Hit:1 http://ua.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://ua.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://ua.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://cran.rstudio.com/bin/linux/ubuntu bionic-cran35/ InRelease
Hit:5 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
Hit:6 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:7 https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ InRelease
Hit:8 https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/ InRelease
Hit:9 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease
Reading package lists... Done
4 step:
sudo apt update
sudo apt install r-base
return:
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.6.2-1xenial) but it is not going to be installed
Depends: r-recommended (= 3.6.2-1xenial) 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.
then I try:
R --version
return:
Command 'R' not found, but can be installed with:
sudo apt install r-base-core
I try:
sudo apt install r-base-core
The following packages have unmet dependencies:
r-base-core : Depends: libreadline6 (>= 6.0) but it is not
installable
Recommends: r-recommended but it is not going to be
installed
Recommends: r-base-dev but it is not going to be
installed
E: Unable to correct problems, you have held broken packages.
You can try two things:
As you already appear to have installed, just to sudo apt-get dist-upgrade. It will list candidate upgrades, you can still back out. Advantage: it resolved interdependent upgrades for you.
Continue what you did but list the affected packages, i.e. sudo apt-get install r-base r-recommended r-base-hmtml. This will work, but may requires several iterative steps.
I took a look at the etc/apt/sources.list file and realised that I had the same repository repeated. I deleted two lines and the problem was solved.
Related
So, I am trying to install R on WSL 2 running Ubuntu 20.04. I followed the instructions here Cran ubuntu packages. As per instructions I added deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/
to /etc/apt/sources.list.
Added the security key sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Ran sudo apt-get update. Checked R packages available: apt list r-base -a.
I get this list:
r-base/bionic-cran40 4.0.1-1.1804.0 all
r-base/bionic-cran40 4.0.0-1.1804.0 all
r-base/bionic 3.4.4-1ubuntu1 all
Finally I ran sudo apt-get install r-base. It threw the following error:
The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 4.0.1-1.1804.0) but it is not going to be installed
Depends: r-recommended (= 4.0.1-1.1804.0) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
So I tried running sudo apt-get install r-base-core. Got the following error:
r-base-core : Depends: liblapack3 but it is not going to be installed or
liblapack.so.3
Recommends: r-recommended but it is not going to be installed
Recommends: r-base-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Does anyone know why this is happening and if there's a way to install R on WSL 2 Ubuntu? There are other related questions here but they are not for Ubuntu 20.04 and R 4. Your help is appreciated. Thank you!
For the benefit of those who may have encountered the same issue, I solved it by replacing my original sources.list file by the one I got from this link. Then I followed the steps found at the R ubuntu packages page again and it installed the latest R version (4.0.3) as expected.
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/'
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
Installing the R language following the instructions at the site [ here ] .
During installation I receive an error "unmet dependencies" at the r-base component using the apt-get install command. See the log with the command sequence below:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Executing: /tmp/tmp.QQyv0HB7mS/gpg.1.sh --keyserver
keyserver.ubuntu.com
--recv-keys
E298A3A825C0D65DFD57CBB651716619E084DAB9
gpg: requesting key E084DAB9 from hkp server keyserver.ubuntu.com
gpg: key E084DAB9: "Michael Rutter <marutter#gmail.com>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
/data/shared/datascience# add-apt-repository 'deb [arch=s390x] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
apt-get update
Hit:1 https://cran.rstudio.com/bin/linux/ubuntu xenial/ InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
Get:3 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease [102 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease [102 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports xenial-updates/main s390x Packages [554 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports xenial-updates/universe s390x Packages [494 kB]
Fetched 1252 kB in 12s (104 kB/s)
Reading package lists... Done
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.0-1xenial0) but it is not going to be installed
Depends: r-recommended (= 3.4.0-1xenial0) 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.
Is this an error in my install procedure, or is this packet broken?
By using the Universal Ubuntu repository and command shown below, the issue was solved:
sudo apt-get install r-base r-base-dev
I am trying to install R on Ubuntu 14.10
When I am giving the command to download r-base, I get the following error
roy#laptop:~$ 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.1.2-1precise0) but it is not going to be installed
Depends: r-recommended (= 3.1.2-1precise0) 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.
What can I do? I found adding backports of raring could help. I tried several servers, but I'm getting a 404.
Here are the following changes I brought in /etc/apt/sources.list
## R
deb http://cran.cnr.Berkeley.edu/bin/linux/ubuntu precise/
## Raring backports
deb http://us.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
Step 1:
You can use any of the below in your /etc/apt/sources.list file to get the latest copy of R, replace <my.favorite.cran.mirror> by the actual URL of your favorite CRAN mirror. See http://cran.r-project.org/mirrors.html for the list of CRAN mirrors.
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu utopic/
or
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu trusty/
or
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu precise/
or
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu lucid/
Step 2:
To install the complete R system, use below on command line:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo add-apt-repository ppa:marutter/rdev
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base
For a detailed instruction, please follow the steps given in the link here!