glady
glady

Reputation: 41

Installation of igraph package of R in ubuntu

I am using the following command for the installation of igraph package of R in ubuntu : install.packages("igraph")

But I am getting an error saying:

Warning: unable to access index for repository
http://ftp.iitm.ac.in/cran/src/contrib: cannot open URL 'http://ftp.iitm.ac.in/cran/src/contrib/PACKAGES' Warning messages: package ‘igraph’ is not available (for R version 3.3.2)

Can someone please guide regarding this problem, where I am going wrong in this...

Upvotes: 4

Views: 5343

Answers (3)

Dirk is no longer here
Dirk is no longer here

Reputation: 368261

You probably want a binary package anyway, and I recently re-explained how to do this:

The easiest way is something like this (and I am showing only the commands, not the output while I do this in a Docker instance of Ubuntu 16.04, and I am doing this in Docker where the account is root; otherwise add sudo in front)

apt-get update     # refresh
apt-get install software-properties-common
add-apt-repository -y "ppa:marutter/rrutter"
add-apt-repository -y "ppa:marutter/c2d4u"
apt-get update     # now with new repos
apt-get install r-cran-igraph

and it will just work with all its dependencies. You didn't tell us what Ubuntu version you have. What I showed works eg in Ubuntu 16.04; for much older releases you need a different package for the add-apt-repository command.

Upvotes: 7

Spacedman
Spacedman

Reputation: 94202

I suspect either the server is down or your network is down or you need to go via a proxy.

I can duplicate this message by setting an unobtainable CRAN mirror with:

> options(repos="http://example.com/")
> install.packages("foo")
Installing package into ‘/nobackup/rowlings/RLibrary/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://example.com/src/contrib:
  cannot open URL 'http://example.com/src/contrib/PACKAGES'

Warning message:
package ‘foo’ is not available (for R version 3.2.3) 

So either try again and maybe the server is up, or check your local network is okay, or try another CRAN mirror, or check with your local network admins to see if you need to set a proxy server.

Upvotes: 0

Derek Corcoran
Derek Corcoran

Reputation: 4092

you have to install build-essential first

sudo apt-get install build-essential

also on Ubuntu and Debian Linux the lixml2 and libxml2-dev packages are needed to install to R.

if that does not work check the webpage of the package for extra documentation

Upvotes: -1

Related Questions