Updating R 3.5.3 to R 4.0.2 on Ubuntu 18.04

7,420

You have to remove problematic PPA (it does no publish packages for 18.04 LTS - bionic) first with:

sudo add-apt-repository -r ppa:grass/grass-stable

and then update your package lists

sudo apt-get update

and install new updates with their dependencies by

sudo apt-get dist-upgrade

You have added R 3.5 repository (see bionic-cran35 in its URL), instead of needed R 4.0 (bionic-cran40). You have to remove wrong repository with

sudo add-apt-repository -r 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'

and then add correct one:

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'
sudo apt-get dist-upgrade
sudo apt-get install r-base r-base-core r-recommended
Share:
7,420
biologistor
Author by

biologistor

Updated on September 18, 2022

Comments

  • biologistor
    biologistor almost 2 years

    I have been trying to move from this version for a while, however all attempts have failed. The steps I am following:

    sudo apt-get remove r-base r-base-dev
    sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
    

    output:

    Err:13 http://ppa.launchpad.net/grass/grass-stable/ubuntu bionic Release     
    404  Not Found [IP: 91.189.95.83 80]
    

    after:

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 
    

    output:

    --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
    gpg: clave 51716619E084DAB9: "Michael Rutter <[email protected]>" sin cambios
    gpg: Cantidad total procesada: 1
    gpg:              sin cambios: 1
    

    after:

    sudo apt update
    

    output:

    Err:13 http://ppa.launchpad.net/grass/grass-stable/ubuntu bionic Release     
    404  Not Found [IP: 91.189.95.83 80]
    

    after:

    sudo apt install r-base r-base-core r-recommended
    

    output:

    r-recommended : Depende: r-cran-boot (>= 1.2.19) pero no va a instalarse
                 Depende: r-cran-cluster (>= 1.9.6-2) pero no va a instalarse
                 Depende: r-cran-foreign (>= 0.7-2) pero no va a instalarse
                 Depende: r-cran-mgcv (>= 1.1.5) pero no va a instalarse
                 Depende: r-cran-rpart (>= 3.1.20) pero no va a instalarse
                 Depende: r-cran-survival (>= 2.13.2-1) pero no va a instalarse
                 Depende: r-cran-mass pero no va a instalarse
                 Depende: r-cran-class pero no va a instalarse
                 Depende: r-cran-nnet pero no va a instalarse
                 Depende: r-cran-codetools pero no va a instalarse
                 Depende: r-cran-matrix pero no va a instalarse
    
  • biologistor
    biologistor about 4 years
    I update various python packages, but not R. After following their steps, I ran: "sudo apt-get install r-base-core". Again, I am in version 3.5.3
  • biologistor
    biologistor about 4 years
    After "sudo apt upgrade r-base r-base-dev", I get: r-base-dev is already in its latest version (3.5.3-1bionic). The following packages have unmet dependencies: r-base: Depends: r-recommended (= 3.5.3-1bionic) but will not install E: Broken packages
  • N0rbert
    N0rbert about 4 years
    See update above.
  • biologistor
    biologistor about 4 years
    r-base: Depends: r-base-core (> = 4.0.2-1.1804.0) but 3.5.3-1bionic is going to be installed Recommends: r-base-html but will not install r-recommended: Depends: r-base-core (> = 4.0.2-1.1804.0) but 3.5.3-1bionic is going to be installed Depends: r-cran-mass but will not install Depends: r-cran-class but will not install Depends: r-cran-nnet but will not install Depends: r-cran-spatial but will not install E: The problems could not be corrected, you have retained broken packages.