1

I am trying to run sudo apt-get update, which I understand to be a prerequisite step to update R with the command sudo apt-get install r-base.

I get as far as this, and then it gets stuck:

Hit:1 http://gb.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://cran.rstudio.com/bin/linux/ubuntu xenial/ InRelease                        
Hit:3 http://ppa.launchpad.net/marutter/rrutter/ubuntu xenial InRelease                 
Get:4 http://gb.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]             
Hit:5 http://dl.google.com/linux/chrome/deb stable InRelease                            
Get:6 http://gb.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]           
Hit:7 http://gb.archive.ubuntu.com/ubuntu xenial-security InRelease            
Hit:8 https://cran.ma.imperial.ac.uk/bin/linux/ubuntu bionic-cran40/ InRelease 
0% [Connecting to cran.stat.ucla.edu (128.97.86.247)]

After a couple of minutes I get the message Could not connect to cran.stat.ucla.edu:80 (128.97.86.247), connection timed out

My internet connection seems okay.

Based on answers to similar questions, I have tried sudo apt --fix-broken install - this runs very quickly and gives the last line 0 to upgrade, 0 to newly install, 0 to remove and 9 not to upgrade. Based on answers to this question, I have tried changing the download server from the default United Kingdom to the 'select best server' recommended http://ubuntu.mirrors.ovh.net/ubuntu, and back again, and I have tried adding -o Acquire::ForceIPv4=true after the apt-get command. Changing the download server changes the list of Hits and Gets, but it still gets stuck connecting to cran.stat.ucla.edu.

Cenlle
  • 13
  • 2
  • Hey I tried to open that link (cran.stat.ucla.edu) using browser as its using port 80 and it did not open, so it seems like it is an issue of "cran.stat.ucla.edu" this repo. Please check it from your end using different internet sources / ISP's. – Hrish Jul 24 '20 at 10:59
  • 1
    https://downforeveryoneorjustme.com/cran.stat.ucla.edu suggests that it is down. – Cenlle Jul 24 '20 at 11:16
  • Did you change the CRAN mirror server, or just the mirror for the Ubuntu repository? The former is what appears to be causing the problem. You can get a list of CRAN mirrors here. – steeldriver Jul 24 '20 at 11:24
  • I have tried putting deb https://www.stats.bris.ac.uk/R/bin/linux/ubuntu xenial-cran40/ in /etc/apt/sources.list , and saving. After appearing to access the Bristol mirror, sudo apt-get update still tries to connect to cran.stat.ucla.edu:80 and gets stuck. – Cenlle Jul 24 '20 at 11:28

1 Answers1

0

The repository server at http://cran.stat.ucla.edu seems to be down, You can try the repositories given at

https://cran.ma.imperial.ac.uk/bin/linux/ubuntu/README.html

Edit: You can use them by appending

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

in

sudo gedit /etc/apt/sources.list

After appending and saving, issue this command

sudo apt-get update
sudo apt-get install r-base

If you get some key error in above commands, issue

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

and repeat update and install commands.