I have debian 12 (boookworm, arm64 version if that matters) installed but I am not able to upgrade R from 4.2.2 to the latest version (4.4.0-2).
if I check the list of upgradable packages is shows that is should be possible to update R:
sudo apt list --upgradable
Listing... Done
r-base-dev/bookworm-cran40 4.4.0-2~bookwormcran.0 all [upgradable from: 4.2.2.20221110-2]
r-base/bookworm-cran40 4.4.0-2~bookwormcran.0 all [upgradable from: 4.2.2.20221110-2]
r-cran-boot/bookworm-cran40 1.3-30-1~bookwormcran.1 all [upgradable from: 1.3-28.1-1]
r-cran-codetools/bookworm-cran40 0.2-20-1~bookwormcran.1 all [upgradable from: 0.2-19-1]
r-recommended/bookworm-cran40 4.4.0-2~bookwormcran.0 all [upgradable from: 4.2.2.20221110-2]
However if try to upgrade them they are held back:
sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
r-base r-base-dev r-cran-boot r-cran-codetools r-recommended
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
If I explicitly name them to be upgraded is shows that the problem is their reliance on r-base-core which needs to be a newer version:
sudo apt upgrade r-base-dev r-base r-cran-boot r-cran-codetools r-recommended
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... 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.4.0-2~bookwormcran.0) but 4.2.2.20221110-2 is to be installed
r-base-dev : Depends: r-base-core (>= 4.4.0-2~bookwormcran.0) but 4.2.2.20221110-2 is to be installed
r-cran-boot : Depends: r-base-core (>= 4.4.0-2~bookwormcran.0) but 4.2.2.20221110-2 is to be installed
r-cran-codetools : Depends: r-base-core (>= 4.4.0-2~bookwormcran.0) but 4.2.2.20221110-2 is to be installed
r-recommended : Depends: r-base-core (>= 4.4.0-2~bookwormcran.0) but 4.2.2.20221110-2 is to be installed
E: Broken packages
Which apparently cannot be updated because it already is at the newest version:
sudo apt upgrade r-base-core
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
r-base-core is already the newest version (4.2.2.20221110-2).
Calculating upgrade... Done
The following packages have been kept back:
r-base r-base-dev r-cran-boot r-cran-codetools r-recommended
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Also trying to install r-core-base 4.4.0-2 does not work:
sudo apt install r-base-core=4.4~bookwormcran.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package r-base-core 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
E: Version '4.4~bookwormcran.0' for 'r-base-core' was not found
This is my /etc/apt/sources.list file
deb https://deb.debian.org/debian bookworm main
deb https://deb.debian.org/debian bookworm-updates main
deb https://deb.debian.org/debian-security/ bookworm-security main
deb http://cloud.r-project.org/bin/linux/debian bookworm-cran40/
the last line, according to the official instructions, should allow me to update to R-4.4 version
2
Answers
I managed to find a working solution, although the approach I used is generally discouraged since it can cause package incompatibilities and even ultimately break the system (so be aware of that in case you try it too).
I noticed the R 4.4 packages were available for debian trixie, so I did that
I added the following lines to the /etc/apt/sources.list file, and commented out everything else
I then ran:
Finally, I restored /etc/apt/sources.list to what it was before
As I said, mixing packages from different Debian versions is generally discouraged (FrankenDebian), however I did so because I thought r-base-core 4.4 was left out by mistake (since r-base and r-base-dev 4.4 are present), so I upgraded only r-base-core and its dependencies from the trixie repository and then reverted back to the standard bookworm repositories. Now running:
does not raise any error or warning, so i think I might have gotten away with it
I was able to install R 4.4 on bookworm by following the instructions for Ubuntu, except for replacing the key and the repo with the key and the repo for Debian, respectively.
The downside of doing so is that only a small subset of the CRAN and BioC packages have been packaged as binaries for Debian with R 4.4. Whereas almost all of them have been packaged as binaries for Debian with R 4.2.2. Ubuntu has a PPA for all the CRAN packages, built with R 4.4. I have never tried installing packages on Debian from a Ubuntu PPA (though you can do so). Of course, you have the option of installing the packages from source.