[R] package update

Dirk Eddelbuettel edd at debian.org
Thu May 12 19:19:38 CEST 2011


On 9 May 2011 at 12:57, Uwe Ligges wrote:
| 
| 
| On 08.05.2011 19:54, eric wrote:
| > I tried to update my packages using update.packages()
| >
| > I got the following message:
| >
| > The downloaded packages are in
| > 	‘/tmp/RtmpyDYdTX/downloaded_packages’
| > Warning in install.packages(update[instlib == l, "Package"], l, contriburl =
| > contriburl,  :
| >    'lib = "/usr/lib/R/library"' is not writable
| > Error in install.packages(update[instlib == l, "Package"], l, contriburl =
| > contriburl,  :
| >    unable to install package
| >
| > How do I fix this ?
| 
| If you want to update packages in R's default library in 
| /usr/lib/R/library, you will need root permissions.

The way it is meant to work is that "you" (eric, the user) become a member of
the group owning that directory -- and I picked group 'staff' for that. 

In the postinst (of the Debian / Ubuntu R packages), this directory is created as

    # edd 03 Apr 2003  cf Section 10.1.2 of Debian Policy
    if [ ! -e /usr/local/lib/R ]; then
      if mkdir /usr/local/lib/R 2>/dev/null; then
	chown root:staff /usr/local/lib/R
	chmod 2775 /usr/local/lib/R
      fi
    fi
    if [ ! -e /usr/local/lib/R/site-library ]; then
      if mkdir /usr/local/lib/R/site-library 2>/dev/null; then
	chown root:staff /usr/local/lib/R/site-library
	chmod 2775 /usr/local/lib/R/site-library
      fi
    fi

We could conceivably be fancier and create an R group on the system, but I
felt this is best left to local admins. 

Alternatively, if you make that directory owned by 'you' then you don't need
root either.

You can check what group you are part of via 'id'. On my Ubuntu box, I am
member of a few groups:

edd at max:~$ id
uid=1000(edd) gid=1000(edd) groups=1000(edd),4(adm),20(dialout),24(cdrom),27(sudo),44(video),46(plugdev),50(staff),107(lpadmin),115(admin),122(sambashare),124(libvirtd)
edd at max:~$ 

Hope this helps,  Dirk 

 
| Uwe Ligges
| 
| 
| 
| >
| > --
| > View this message in context: http://r.789695.n4.nabble.com/package-update-tp3507479p3507479.html
| > Sent from the R help mailing list archive at Nabble.com.
| >
| > ______________________________________________
| > R-help at r-project.org mailing list
| > https://stat.ethz.ch/mailman/listinfo/r-help
| > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
| > and provide commented, minimal, self-contained, reproducible code.
| 
| ______________________________________________
| R-help at r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-help
| PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
| and provide commented, minimal, self-contained, reproducible code.

-- 
Gauss once played himself in a zero-sum game and won $50.
                      -- #11 at http://www.gaussfacts.com



More information about the R-help mailing list