[R] Problems in package management after Linux system upgrade

Paul Johnson pauljohn32 at gmail.com
Wed Apr 5 17:56:21 CEST 2006

I upgraded from Fedora Core 4 to Fedora Core 5 and I find a lot of
previously installed packages won't run because shared libraries or
other system things have changed "out from under" the installed R
libraries.  I do not know for sure if the R version now from
Fedora-Extras (2.2.1) is exactly the same one I was using in FC4.

I see problems in many packages. Example, Hmisc:
	unable to load shared library '/usr/lib/R/library/Hmisc/libs/Hmisc.so':
  libgfortran.so.0: cannot open shared object file: No such file or directory
Error in library(Hmisc) : .First.lib failed for 'Hmisc'

If I manually do a re-install, then Hmisc and the other packages are fine.

I ?THINK? that if I had been using version 2.2.0, and now I have
2.2.1, then the checkBuilt option would force a rebuild on all
packages. Right?

I'm pasting in below the script that I run nightly to update all
packages and install any new ones in CRAN.  Can anybody suggest
changes that might cause a rebuild of packages that need rebuilding?

## PJ 2005-11-05
options(repos = "http://cran.cnr.berkeley.edu/")

#failPackages is the "black list".  Things get inserted for various reasons

#rejected because they don't build on my system as of July, 2005, or
are obviously not needed
failPackages1 <-

#rejected because I subjectively think we don't need them
failPackages2 <-

failPackages3 <- c("rcom","Rlsf")

#put the 3 sets of rejects together
failPackages <- union(failPackages1,union(failPackages2,failPackages3))

#list of all currently installed packages
installedPackages <- rownames (installed.packages() )

#do any installed packages need removal because they are on the blacklist?
needRemoval <-  installedPackages %in% failPackages

# remove any blacklisted packages if they are already installed.
if (sum(needRemoval) >0)   remove.packages(installedPackages[needRemoval] )

#update the ones you want to keep
update.packages(ask=F, checkBuilt=T)

#get list of all new packages on CRAN
theNew <- new.packages()

#do any of the new packages belong to the black list?
shouldFail <- theNew %in% failPackages

#install non blacklisted packages that are in theNew list
if (sum(!shouldFail) > 0) install.packages( theNew[!shouldFail],dependencies=T)

# VGAM is not in CRAN yet, but Zelig will use it.

if ( "VGAM" %in% installedPackages)
  update.packages(repos="http://www.stat.auckland.ac.nz/~yee",ask=F) else
  install.packages("VGAM", repos="http://www.stat.auckland.ac.nz/~yee")

Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas

More information about the R-help mailing list