In general, this is better resolved by
  1) Creating a directory
/usr/lib64/R/site-library
and change it permissions to what you want.  Specifically, due to settings
in R, if this directory is group writable, everything R installs here
becomes group writable as well.  In my institution we basically have a
group containing people with permission to install packages system-wide and
this is the group which owns this directory.

2) Run your installation scripts, like biocLite.

You can check that 1) has been achieved by starting R and executing
 R> .libPaths()
You should see the site-library at the beginning of the vector.

The only thing is that packages shipped with R, like MASS is install
in library, not site-library, so you cannot update these without
system privileges.

Best,
Kasper


On Sun, May 18, 2014 at 1:32 PM, Dan Tenenbaum <dtenenba@fhcrc.org> wrote:

>
>
> ----- Original Message -----
> > From: "Juergen Rose" <rose@rz.uni-potsdam.de>
> > To: "Dan Tenenbaum" <dtenenba@fhcrc.org>
> > Cc: "Juergen Rose [guest]" <guest@bioconductor.org>, "vsn Maintainer" <
> huber@ebi.ac.uk>, bioconductor@r-project.org
> > Sent: Sunday, May 18, 2014 3:38:34 AM
> > Subject: Re: [BioC] R-3.1.0: biocLite("vsn") removes all files in /
> >
> > Am Sonntag, den 18.05.2014, 00:03 -0700 schrieb Dan Tenenbaum:
> > > Hi Juergen,
> > >
> > > ----- Original Message -----
> > > > From: "Juergen Rose [guest]" <guest@bioconductor.org>
> > > > To: bioconductor@r-project.org, rose@rz.uni-potsdam.de
> > > > Cc: "vsn Maintainer" <huber@ebi.ac.uk>
> > > > Sent: Saturday, May 17, 2014 11:09:44 PM
> > > > Subject: [BioC] R-3.1.0: biocLite("vsn") removes all files in /
> > > >
> > > > I had the following files in /:
> > > >
> > > > root@caiman:/root(8)# ll /
> > > > total 160301
> > > > drwxr-xr-x   2 root root      4096 May 16 12:23 bin/
> > > > drwxr-xr-x   6 root root      3072 May 14 13:58 boot/
> > > > -rw-r--r--   1 root root     38673 May 14 14:22 boot_local-d.log
> > > > lrwxrwxrwx   1 root root        11 Jan 22  2011 data ->
> > > > data_caiman/
> > > > drwxr-xr-x   7 root root      4096 Mar  9 22:29 data_caiman/
> > > > lrwxrwxrwx   1 root root        23 Dec 29 13:43 data_impala ->
> > > > /net/impala/data_impala/
> > > > lrwxrwxrwx   1 root root        21 Jan 27 08:13 data_lynx2 ->
> > > > /net/lynx2/data_lynx2/
> > > > drwxr-xr-x  21 root root      4040 May 14 14:40 dev/
> > > > drwxr-xr-x 160 root root     12288 May 17 17:14 etc/
> > > > -rw-------   1 root root     15687 Dec 26 13:42 grub.cfg_old
> > > > lrwxrwxrwx   1 root root        11 Jan 23  2011 home ->
> > > > home_caiman/
> > > > drwxr-xr-x   5 root root      4096 Dec 26 11:31 home_caiman/
> > > > lrwxrwxrwx   1 root root        23 Dec 29 13:43 home_impala ->
> > > > /net/impala/home_impala/
> > > > lrwxrwxrwx   1 root root        21 Jan 27 08:13 home_lynx2 ->
> > > > /net/lynx2/home_lynx2/
> > > > lrwxrwxrwx   1 root root         5 Mar 30 04:25 lib -> lib64/
> > > > drwxr-xr-x   3 root root      4096 May 14 04:31 lib32/
> > > > drwxr-xr-x  17 root root     12288 May 16 12:23 lib64/
> > > > -rw-r--r--   1 root root   1797418 May 14 14:22 login.log
> > > > drwx------   2 root root     16384 Jan 20  2011 lost+found/
> > > > drwxr-xr-x   2 root root         0 May 14 14:21 misc/
> > > > drwxr-xr-x  10 root root      4096 Nov  4  2013 mnt/
> > > > drwxr-xr-x   4 root root         0 May 17 17:38 net/
> > > > drwxr-xr-x  13 root root      4096 Feb 13 13:25 opt/
> > > > dr-xr-xr-x 270 root root         0 May 14 14:21 proc/
> > > > drwx------  36 root root      4096 May 17 15:00 root/
> > > > drwxr-xr-x  30 root root       840 May 16 18:21 run/
> > > > drwxr-xr-x   2 root root     12288 May 16 12:23 sbin/
> > > > -rw-r--r--   1 root root 162191459 Jan 13  2011
> > > > stage3-amd64-20110113.tar.bz2
> > > > dr-xr-xr-x  12 root root         0 May 14 14:21 sys/
> > > > drwxrwxrwt  16 root root      1648 May 17 17:14 tmp/
> > > > drwxr-xr-x  19 root root      4096 May  6 04:40 usr/
> > > > drwxr-xr-x  16 root root      4096 Dec 26 11:17 var/
> > > >
> > > >
> > > > Then I did as root:
> > > > R
> > > > > source("http://bioconductor.org/biocLite.R")
> > > > > biocLite("vsn")
> > > >
> > > > Save workspace image? [y/n/c]: n
> > > > root@caiman:/root(15)# ll /
> > > > total 93
> > > > drwxr-xr-x   2 root root  4096 May 16 12:23 bin/
> > > > drwxr-xr-x   6 root root  3072 May 14 13:58 boot/
> > > > drwxr-xr-x   7 root root  4096 Mar  9 22:29 data_caiman/
> > > > drwxr-xr-x  21 root root  4040 May 14 14:40 dev/
> > > > drwxr-xr-x 160 root root 12288 May 17 17:14 etc/
> > > > drwxr-xr-x   5 root root  4096 Dec 26 11:31 home_caiman/
> > > > drwxr-xr-x   3 root root  4096 May 14 04:31 lib32/
> > > > drwxr-xr-x  17 root root 12288 May 16 12:23 lib64/
> > > > drwx------   2 root root 16384 Jan 20  2011 lost+found/
> > > > drwxr-xr-x   2 root root     0 May 14 14:21 misc/
> > > > drwxr-xr-x  10 root root  4096 Nov  4  2013 mnt/
> > > > drwxr-xr-x   2 root root     0 May 17 17:38 net/
> > > > drwxr-xr-x  13 root root  4096 Feb 13 13:25 opt/
> > > > dr-xr-xr-x 272 root root     0 May 14 14:21 proc/
> > > > drwx------  36 root root  4096 May 17 15:00 root/
> > > > drwxr-xr-x  30 root root   840 May 16 18:21 run/
> > > > drwxr-xr-x   2 root root 12288 May 16 12:23 sbin/
> > > > dr-xr-xr-x  12 root root     0 May 17 17:38 sys/
> > > > drwxrwxrwt  19 root root  1752 May 17 18:33 tmp/
> > > > drwxr-xr-x  19 root root  4096 May  6 04:40 usr/
> > > > drwxr-xr-x  16 root root  4096 Dec 26 11:17 var/
> > > >
> > > > I.e., all not directory files in / disappeared. This happens on
> > > > two
> > > > systems. I know it is a risk to run scripts from the internet as
> > > > root. But what would be the alternative to install a bioconductor
> > > > package for all users?
> > > >
> > >
> > > I don't know why this happened. We'll need to investigate further.
> > >
> > > However, you could install BiocInstaller (the package that provides
> > > biocLite()) as follows (you don't need to be root):
> > >
> > > install.packages("BiocInstaller",
> > > repos="http://bioconductor.org/packages/3.0/bioc")
> > >
> > > Then you can install packages as follows:
> > > library(BiocInstaller)
> > > biocLite("vsn")
> > >
> > > Note that you don't have to be root to install packages tha are
> > > accessible to all users.
> > > You just have to install them to a directory that you have
> > > permissions to write to.
> > >
> > > You can start R (as any user) and see where it will look for
> > > packages by doing:
> > >
> > > .libPaths()
> > >
> > > Then arrange to give yourself (a non-root user) write permissions
> > > to that directory, and then install packages with biocLite() as
> > > described above. If the installation is indeed removing files from
> > > /, it should now not be able to do so if it doesn't have
> > > permission to do so.
> > >
> > > Dan
> >
> > Thanks Dan,
> >
> > I tried this.  I am belonging to group portage and the R-packages are
> > installed under /usr/lib64/R/library. Therefore I changed the group
> > of /usr/lib64/R/library to portage and made it writable by portage:
> >
> > root@lynx2:/root(21)# ll -d /usr/lib64/R/library
> > drwxrwxr-x 40 root portage 4096 May 18 12:10 /usr/lib64/R/library/
>
>
> Maybe try changing permissions recursively?
>
> sudo chgrp -R portage /usr/lib64/R/library
>
> Dan
>
>
> >
> > Then I tried as user rose to install vsn (some empty lines removed):
> >
> > rose@lynx2:/home/rose(1)$ R
> >
> > R version 3.1.0 (2014-04-10) -- "Spring Dance"
> > Copyright (C) 2014 The R Foundation for Statistical Computing
> > Platform: x86_64-pc-linux-gnu (64-bit)
> > R ist freie Software und kommt OHNE JEGLICHE GARANTIE.
> > Sie sind eingeladen, es unter bestimmten Bedingungen weiter zu
> > verbreiten.
> > Tippen Sie 'license()' or 'licence()' für Details dazu.
> > R ist ein Gemeinschaftsprojekt mit vielen Beitragenden.
> > Tippen Sie 'contributors()' für mehr Information und 'citation()',
> > um zu erfahren, wie R oder R packages in Publikationen zitiert werden
> > können.
> > Tippen Sie 'demo()' für einige Demos, 'help()' für on-line Hilfe,
> > oder
> > 'help.start()' für eine HTML Browserschnittstelle zur Hilfe.
> > Tippen Sie 'q()', um R zu verlassen.
> >
> > > .libPaths()
> > [1] "/usr/lib64/R/library"
> > > library(BiocInstaller)
> > Bioconductor version 3.0 (BiocInstaller 1.15.5), ?biocLite for help
> > > biocLite("vsn")
> > BioC_mirror: http://bioconductor.org
> > Using Bioconductor version 3.0 (BiocInstaller 1.15.5), R version
> > 3.1.0.
> > Installing package(s) 'vsn'
> > also installing the dependencies ‘affyio’, ‘preprocessCore’,
> > ‘zlibbioc’,
> > ‘Biobase’, ‘affy’, ‘limma’
> > versuche URL
> > '
> http://bioconductor.org/packages/3.0/bioc/src/contrib/affyio_1.33.0.tar.gz
> '
> > Content type 'application/x-gzip' length 114002 bytes (111 Kb)
> > URL geöffnet
> > ==================================================
> > downloaded 111 Kb
> > versuche URL
> > '
> http://bioconductor.org/packages/3.0/bioc/src/contrib/preprocessCore_1.27.0.tar.gz
> '
> > Content type 'application/x-gzip' length 120390 bytes (117 Kb)
> > URL geöffnet
> >
> > ...
> >
> > installing to /usr/lib64/R/library/affyio/libs
> > ** R
> > ** preparing package for lazy loading
> > ** help
> > *** installing help indices
> > ** building package indices
> > ** testing if installed package can be loaded
> > * DONE (affyio)
> > ERROR: dependency ‘Biobase’ is not available for package ‘affy’
> > * removing ‘/usr/lib64/R/library/affy’
> > ERROR: dependencies ‘Biobase’, ‘affy’ are not available for package
> > ‘vsn’
> > * removing ‘/usr/lib64/R/library/vsn’
> >
> > The downloaded source packages are in
> >         ‘/tmp/Rtmp4RcqFj/downloaded_packages’
> > Updating HTML index of packages in '.Library'
> > Old packages: 'BiocGenerics', 'MASS', 'RBGL', 'graph', 'slam'
> > Update all/some/none? [a/s/n]: a
> > versuche URL
> > '
> http://bioconductor.org/packages/3.0/bioc/src/contrib/BiocGenerics_0.11.2.tar.gz
> '
> > Content type 'application/x-gzip' length 32452 bytes (31 Kb)
> > URL geöffnet
> > ...
> >
> > This results in permission errors:
> >
> > versuche URL 'http://cran.fhcrc.org/src/contrib/slam_0.1-32.tar.gz'
> > Content type 'application/x-gzip' length 46672 bytes (45 Kb)
> > URL geöffnet
> > ==================================================
> > downloaded 45 Kb
> >
> > * installing *source* package ‘BiocGenerics’ ...
> > mv: das Verschieben von „/usr/lib64/R/library/BiocGenerics“ nach
> > „/usr/lib64/R/library/00LOCK-BiocGenerics/BiocGenerics“ ist nicht
> > möglich: Keine Berechtigung
> > Warnung in file.copy(f, instdir, TRUE) :
> >   Problem ./NAMESPACE nach
> >   /usr/lib64/R/library/BiocGenerics/NAMESPACE
> > zu kopieren: Keine Berechtigung
> > Warnung in file(file, ifelse(append, "a", "w")) :
> >   kann Datei '/usr/lib64/R/library/BiocGenerics/DESCRIPTION'
> > nicht ?ffnen: Keine Berechtigung
> > Error in file(file, ifelse(append, "a", "w")) :
> >   kann Verbindung nicht ?ffnen
> > ERROR: installing package DESCRIPTION failed for package
> > ‘BiocGenerics’
> > * removing ‘/usr/lib64/R/library/BiocGenerics’
> > * installing *source* package ‘MASS’ ...
> > ** Paket ‘MASS’ erfolgreich entpackt und MD5 Summen überprüft
> > mv: das Verschieben von „/usr/lib64/R/library/MASS“ nach
> > „/usr/lib64/R/library/00LOCK-MASS/MASS“ ist nicht möglich: Keine
> > Berechtigung
> > Warnung in file.copy(f, instdir, TRUE) :
> >   Problem ./NAMESPACE nach /usr/lib64/R/library/MASS/NAMESPACE zu
> > kopieren: Keine Berechtigung
> > Warnung in file(file, ifelse(append, "a", "w")) :
> >   kann Datei '/usr/lib64/R/library/MASS/DESCRIPTION' nicht ?ffnen:
> >   Keine
> > Berechtigung
> > Error in file(file, ifelse(append, "a", "w")) :
> >   kann Verbindung nicht ?ffnen
> > ERROR: installing package DESCRIPTION failed for package ‘MASS’
> > * removing ‘/usr/lib64/R/library/MASS’
> > * installing *source* package ‘slam’ ...
> > ** Paket ‘slam’ erfolgreich entpackt und MD5 Summen überprüft
> > mv: das Verschieben von „/usr/lib64/R/library/slam“ nach
> > „/usr/lib64/R/library/00LOCK-slam/slam“ ist nicht möglich: Keine
> > Berechtigung
> > Warnung in file.copy(f, instdir, TRUE) :
> >   Problem ./NAMESPACE nach /usr/lib64/R/library/slam/NAMESPACE zu
> > kopieren: Keine Berechtigung
> > Warnung in file(file, ifelse(append, "a", "w")) :
> >   kann Datei '/usr/lib64/R/library/slam/DESCRIPTION' nicht ?ffnen:
> >   Keine
> > Berechtigung
> > Error in file(file, ifelse(append, "a", "w")) :
> >   kann Verbindung nicht ?ffnen
> > ERROR: installing package DESCRIPTION failed for package ‘slam’
> > * removing ‘/usr/lib64/R/library/slam’
> > * installing *source* package ‘graph’ ...
> > mv: das Verschieben von „/usr/lib64/R/library/graph“ nach
> > „/usr/lib64/R/library/00LOCK-graph/graph“ ist nicht möglich: Keine
> > Berechtigung
> > Warnung in file.copy(f, instdir, TRUE) :
> >   Problem ./NAMESPACE nach /usr/lib64/R/library/graph/NAMESPACE zu
> > kopieren: Keine Berechtigung
> > Warnung in file(file, ifelse(append, "a", "w")) :
> >   kann Datei '/usr/lib64/R/library/graph/DESCRIPTION' nicht ?ffnen:
> > Keine Berechtigung
> > Error in file(file, ifelse(append, "a", "w")) :
> >   kann Verbindung nicht ?ffnen
> > ERROR: installing package DESCRIPTION failed for package ‘graph’
> > * removing ‘/usr/lib64/R/library/graph’
> > * installing *source* package ‘RBGL’ ...
> > mv: das Verschieben von „/usr/lib64/R/library/RBGL“ nach
> > „/usr/lib64/R/library/00LOCK-RBGL/RBGL“ ist nicht möglich: Keine
> > Berechtigung
> > untarring boost include tree...
> > Warnung in file.copy(f, instdir, TRUE) :
> >   Problem ./NAMESPACE nach /usr/lib64/R/library/RBGL/NAMESPACE zu
> > kopieren: Keine Berechtigung
> > Warnung in file.copy(f, instdir, TRUE) :
> >   Problem ./NEWS nach /usr/lib64/R/library/RBGL/NEWS zu kopieren:
> >   Keine
> > Berechtigung
> > Warnung in file(file, ifelse(append, "a", "w")) :
> >   kann Datei '/usr/lib64/R/library/RBGL/DESCRIPTION' nicht ?ffnen:
> >   Keine
> > Berechtigung
> > Error in file(file, ifelse(append, "a", "w")) :
> >   kann Verbindung nicht ?ffnen
> > ERROR: installing package DESCRIPTION failed for package ‘RBGL’
> > * removing ‘/usr/lib64/R/library/RBGL’
> >
> > The downloaded source packages are in
> >         ‘/tmp/Rtmp4RcqFj/downloaded_packages’
> > Updating HTML index of packages in '.Library'
> > Es gab 12 Warnungen (Anzeige mit warnings())
> >
> > After leaving R I can't find a /usr/lib64/R/library/vsn directory:
> >
> >
> > root@lynx2:/root(23)# ll /usr/lib64/R/library/vsn
> > /bin/ls: cannot access /usr/lib64/R/library/vsn: No such file or
> > directory
> >
> >
> > The only packages installed today under /usr/lib64/R/library are the
> > first five directories of the following list:
> >
> > rose@lynx2:/home/rose(3)$ ll -t  /usr/lib64/R/library/ | head
> > insgesamt 168
> > drwxrwxr-x  7 rose rose 4096 18. Mai 12:22 affyio/
> > drwxrwxr-x  8 rose rose 4096 18. Mai 12:22 limma/
> > drwxrwxr-x  9 rose rose 4096 18. Mai 12:22 zlibbioc/
> > drwxrwxr-x  8 rose rose 4096 18. Mai 12:22 preprocessCore/
> > drwxr-xr-x  8 root root 4096 18. Mai 12:10 BiocInstaller/
> > drwxr-xr-x  8 root root 4096  3. Mai 19:06 scatterplot3d/
> > drwxr-xr-x 10 root root 4096 16. Apr 09:17 MASS/
> > drwxr-xr-x  7 root root 4096 16. Apr 09:17 base/
> > drwxr-xr-x  8 root root 4096 16. Apr 09:17 boot/
> >
> >
> > Any further hint is appreciated.
> >
> >
> >
> >
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

