This article is for you if you get the following error message:
r-base : Depends: r-recommended (= 4.0.0-1~bustercran.0) but it is not going to be installed
R 4.0.0 is finally out!
That might sound super geeky, but that’s the first time I feel so excited for a major version of whatever technology.
I was still a kid when R 3.0.0 got out.
But nowadays, I do R every day. I eat R. I sleep R. I am R.
(Ok I’ll stop.)
This article is not here to tell you what’s new in R 4.0.0.
You can refer to this article instead:
Or the official message:
In this article, I want to show you how to upgrade R on Debian.
Because I struggled.
And I don’t want anyone else to struggle too.
Pretty much all my servers use Debian. It’s stable. It just works.
But when you install R on a fresh Debian, you get R 3.5.2.
Who would want to use R 3.5.2 in 2020?
So, to install the latest version, you must:
- Add a GnuPG key
- Add the repo address of R
And in this article, I’ll suppose you have already done that.
That means you’re probably currently using R 3.6.3 and you want to upgrade.
But, like me, you got trouble.
If you open
/etc/apt/sources.list on your server, you should see this line:
On this line, we can see two things:
- I’m using
buster, which is Debian 10.
- And the
cran35gives me access to the latest version of R 3.x.x.
The naive solution
So if you want to update R, you simple update the repo address, then
apt update, and finally
Not this time.
But let’s try!
The new address is:
If I replace it in my
/etc/apt/sources.list file, and then I do:
A few libraries will be updated, but not R. Instead, we will get told this:
Because of conflicts in the dependencies.
You can try to force the install though:
Except it doesn’t work either.
You’ll get this message:
So what do we do?
The good solution
In fact, everything is explained on the CRAN website.
Here: Installation instructions.
First, they give you the new repo address. That’s good. We’ve already done that.
And then they say:
Please refer to the section on bullseye above for hints on how to do the reinstallation of extension packages. Of course you need to substitute “bullseye” for “buster” if this is the distribution you are working with.
Instead of writing
sudo apt install r-base, let’s try:
These commands uninstall R first. And then install it again with this new parameter.
And it works!
Happy R ;)
Leave a Comment
Required fields are marked *