[R] install.packages() - old version deleted, new version did not install
Duncan Murdoch
murdoch.duncan at gmail.com
Tue Dec 21 02:22:12 CET 2010
I've just tentatively put code to fix this in place in R-devel. By
default it is not enabled, because if it goes wrong it could really mess
things up. To enable it, set
options(install.lock=TRUE)
before installing or updating binary packages in Windows. It will slow
down all installs, so it may be that the default should stay no-locking
as it is now: only people running multiple instances of R really need this.
Since it appealed to my sense of symmetry, you can also say
options(install.lock=FALSE)
which will mean that source installs done by install.packages() will
default to act like R CMD INSTALL --unsafe, i.e. go ahead without
locking. The latter change affects all platforms, not just Windows.
You should be able to download R-devel builds containing this change by
tomorrow; look for revision r53875 or newer.
Duncan Murdoch
On 17/12/2010 11:13 AM, Jon Olav Skoien wrote:
> Dear list,
>
> (R 2.12.0, Windows 7, 64bit)
>
> I recently tried to install a new package ("spacetime"), that depends on
> "sp" among others. I already had the last one installed, but there was
> probably a newer version on CRAN, so the command
> > install.packages("spacetime")
> also gave me:
> also installing the dependencies ‘sp’, ‘zoo’, ‘xts’
>
> sp was already loaded in this session, so installation failed:
> package 'sp' successfully unpacked and MD5 sums checked
> Warning: cannot remove prior installation of package 'sp'
>
> Unfortunately, the warning should rather say:
> "cannot completely remove prior installation of package 'sp'"
> R managed to remove most of the prior installation of sp, except for the
> .dll. I could go on using sp in the existing sessions, but not load the
> package in a new session or open the help pages. This has happened to me
> several times, and the only solution I have found to this is to close
> all R-sessions and install the package again. This is normally ok, but
> this time I had some long-time computations running in another R-session
> that I did not want to interrupt. For the next time, is there a way to
> reinstall a package without interrupting running R-sessions?
>
> For me it seems like the cause of the problem could have been solved by
> checking if the .dll can be removed before removing the rest of the
> package, by adding something like the following in utils:::unpackPkgZip?
> if (unlink(paste(instPath,"/libs/x64/sp.dll", sep = "")) != 0)
> warning("cannot remove...")
> before
> ret<- unlink(instPath, recursive = TRUE) (line 95)
> x64 in the path would have to be changed to something architecture
> dependent...
>
> Best wishes,
> Jon
>
> ______________________________________________
> 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.
More information about the R-help
mailing list