Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to update/install packages in R 3.2.2 running on Google Compute Engine (Debian Wheezy )

I have created a basic instance on Google Compute Engine running on Debian wheezy. My objective is to install R on an instance and access it remotely via Jupyter/Ipython notebook.

The problem I am facing is that once I install R 3.2.2. "Fire Safety" and I try to update the packages using update.packages(), I am unable to do so and I get a Warning stating: unable to access index for repository https://cran.<rest of mirror address> This is irrespective of which CRAN mirror I choose (18 mirror options). Similarly, if I try to install basic packages like jsonlite using install.packages('jsonlite') I get a similar error:

Warning: unable to access index for repository https://cran.cnr.Berkeley.edu/src/contrib Warning message: package ‘jsonlite’ is not available (for R version 3.2.2). Again, this error is irrespective of the mirror I choose.

If it helps in any way for the diagnosis, the way I am installing R, right after a fresh instance is created, goes as follows:

sudo apt-get update
sudo apt-get upgrade
sudo -i
echo "deb http://cran.r-project.org/bin/linux/debian wheezy-cran3/" > /etc/apt/sources.list.d/cran.list
apt-get update
apt-get upgrade
apt-get install r-base-core r-base-dev

Can anyone suggest what might be causing this update/install package problem?

like image 650
Mario H Avatar asked Mar 14 '23 23:03

Mario H


1 Answers

Two quick ideas:

  1. Replace the https with http, e.g. in install.packages("digest", repos="http://cran.cnr.berkeley.edu")

  2. Switch the repo to one where we know https is supported, e.g. install.packages("digest", repos="https://cran.rstudio.com")

I can use the Berkeley host via both http and https, but maybe AWS blocks port 443?

like image 76
Dirk Eddelbuettel Avatar answered Mar 17 '23 14:03

Dirk Eddelbuettel