Upgrading to R-4.0

Hello everyone, I have some trouble upgrading R to version R-4.0 and surprisingly there are no subjects on that topic.

I have tried two methods, which both failed.

  1. Command line:

sudo apt upgrade r-base r-base-dev

[sudo] password for usr:
Reading package lists... Done
Building dependency tree
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.0.2-1.1804.0) but 3.6.3-2 is to be installed
Depends: r-recommended (= 4.0.2-1.1804.0) but 3.6.3-2 is to be installed
r-base-dev : Depends: r-base-core (>= 4.0.2-1.1804.0) but 3.6.3-2 is to be installed
E: Broken packages

  1. With downloaded packages, in the R-4.0.2 folder.

(lots of positive checks)
checking for X... no
configure: error: --with-x=yes (default) and X11 headers/libs are not available

make: *** No targets specified and no makefile found. Stop.

Would anyone had encountered the same problems?

On which OS are you ?

I believe you are on Ubuntu right? You can follow the official installation instructions from CRAN


I am working on Ubuntu 20.04.1 LTS.

Thank you for your link andresrcs! I have tried the installation command:

deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/

But the command deb is not recognized.
I have tried to understand how to manage it, notably consulting https://askubuntu.com/questions/233064/why-am-i-getting-command-deb-not-found, but I don't understand the answer.
Could anyone point me how to install the command deb?

There is also this blog post which can help


That is not a command, that is an entry you have to add to your source list file, read the instructions again more carefully or follow the blog post cderv mentioned.

BTW this is the one you want to use since you are on Ubuntu 20

deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/
1 Like

Thanks for the turorial cderv! It is very didactic!

Strangely, I have now R4.0.2 in RStudio, and calling R in a terminal call R version 3.6.1. It is odd...

Thanks for all the help!

1 Like

And thanks for the link andresrcs, I have modified my /etc/apt/sources.list file accordingly.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.