Paul Heinrich Dietrich
2009-Feb-07 03:12 UTC
[R] Problems installing/updating packages in Linux
Hi all, I feel very comfortable with R in Windows, and am trying to switch over to Linux. I have R 2.8.1 on Linux and it works great (so far), except for instalilng/updating packages. For example, using Emacs with ESS as a text editor, I entered:> update.packages()Here are some error messages: /usr/lib/R/bin/INSTALL: 1088: cannot create /usr/share/R/doc/html/search/index.txt: Permission denied The downloaded packages are in /tmp/RtmpV6DGUE/downloaded_packages Updating HTML index of packages in '.Library' Warning messages: 1: In file.create(f.tg) : cannot create file '/usr/share/R/doc/html/packages.html', reason 'Permission denied' 2: In tools:::unix.packages.html(.Library) : cannot create HTML package index>I thought this was a permissions-based issue, so I learned online that to grant permissions to everything in my R directories, to do this in the Linux terminal: chmod -R 777 ./directory And I applied that to several R directories, including /usr/lib/R and a place in /home where I store all my scripts, data sets, etc. I thought that would solve it, but I'm still getting the same permissions-based errors. I could really use some help from someone who knows Linux. Thanks. -- View this message in context: http://www.nabble.com/Problems-installing-updating-packages-in-Linux-tp21884607p21884607.html Sent from the R help mailing list archive at Nabble.com.
On Fri, 6 Feb 2009 19:12:09 -0800 (PST) Paul Heinrich Dietrich <paul.heinrich.dietrich at gmail.com> wrote: PHD> I feel very comfortable with R in Windows, and am trying to switch PHD> over to Linux. I have R 2.8.1 on Linux and it works great (so PHD> far), except for instalilng/updating packages. For example, using PHD> Emacs with ESS as a text editor, I entered: I usually update R packages as superuser (terminal: su + pwd, type R, then update.packages() ). Maybe not the most secure way but other logins might use the updated packages as well and there are no permission problems. hth Stefan
Prof Brian Ripley
2009-Feb-07 10:17 UTC
[R] Problems installing/updating packages in Linux
On Fri, 6 Feb 2009, Paul Heinrich Dietrich wrote:> > Hi all, > I feel very comfortable with R in Windows, and am trying to switch over to > Linux. I have R 2.8.1 on Linux and it works great (so far), except forI suspect you didn't install it in any of the ways described in the R-admin manual. An RPM or .deb, perhaps? If so, please give details and ask on r-sig-fedora or r-sig-debian as appropriate.> instalilng/updating packages. For example, using Emacs with ESS as a text > editor, I entered: > >> update.packages() > > Here are some error messages: > > /usr/lib/R/bin/INSTALL: 1088: cannot create > /usr/share/R/doc/html/search/index.txt: Permission denied > > The downloaded packages are in > /tmp/RtmpV6DGUE/downloaded_packages > Updating HTML index of packages in '.Library' > Warning messages: > 1: In file.create(f.tg) : > cannot create file '/usr/share/R/doc/html/packages.html', reason > 'Permission denied' > 2: In tools:::unix.packages.html(.Library) : > cannot create HTML package index >> > > I thought this was a permissions-based issue, so I learned online that to > grant permissions to everything in my R directories, to do this in the Linux > terminal: > > chmod -R 777 ./directory > > And I applied that to several R directories, including /usr/lib/R and a > place in /home where I store all my scripts, data sets, etc. I thought that > would solve it, but I'm still getting the same permissions-based errors. I > could really use some help from someone who knows Linux. Thanks.It _is_ a permissions issue on /usr/share/R: note what the error messages say about problematic file paths. I suspect you are trying to update packages that shipped with R: you are expected to do that under the account used to install R (probably root in your case). We install software under a separate account (not root, not any regular user) and that enables us to do autmated updates safely using a crontab job run from that acccount. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595