Upgrading from RStudio 3.19 to 3.20.1 can cause installed libraries to no longer be found
Problem
When upgrading our RStudio image to 3.20.1 on an existing Persistent Disk can sometimes cause already installed R libraries to appear as if they have been uninstalled.
This happens because the default location for libraries to be installed on the 3.19 image is /home/rstudio/R/x86_64-pc-linux-gnu-library/4.4-3.19. This is automatically added to the path variable that R needs to execute installed libraries. You can confirm this by running .libPaths() in RStudio.
However when upgrading to the latest version 3.20.1 on that same persistent disk will have this directory (/home/rstudio/R/x86_64-pc-linux-gnu-library/4.4-3.20) added to the path and not the one for 3.19 that still exists on the disk.
This is expected behavior by the Bioconductor team.
3.19 is a locked release, permanently available to support reproducible work. 3.20 is the current release and packages in use may be "upgraded" to fix bugs discovered during the release cycle. BiocManager::valid() will check the user's current selection of version in use and will synchronize all packages to the chosen release.
Workaround
As mentioned above, the directory with the already installed libraries still exists, it just doesn't show up if .libPaths() is ran. So we'll need to add it to our R install's path with this command
.libPaths(c("/home/rstudio/R/x86_64-pc-linux-gnu-library/4.4-3.19",.libPaths()))
After that, the existing directory should appear in the path and the libraries should be able to be used as normal.
Comments
0 comments
Please sign in to leave a comment.