Delete package from Connect's global cache

I am trying to deploy an application that relies on the sf package. I recently tried to deploy the app with an older version of gdal and proj installed. This resulted in an issue that I was later able to resolve by building newer versions of the packages from source. However, the current installation of sf in the connect global cache was built against the older versions of gdal and proj.

My question is, where is the global cache stored on the server and is there a way to delete the previous versions of a package so that when I redeploy the app the package will be rebuilt against the correct versions of its source software? I have read through the admin guide's sections on package management and I am not seeing anything about managing the global cache.

1 Like


You'll want:

sudo /opt/rstudio-connect/bin/migrate rebuild-packrat --force

This command will rebuild the entire cache and ALL packages for ALL content, so it could take a long time to run and would require downtime for the Connect server.



The section from the link you provided says that it can be run while the server is running, is that not true or is there other downtime that would occur that I am missing?

  • rebuild-packrat : Rebuilds the Packrat cache for all content on the server. This command can be used WHILE RStudio Connect is running.

You can execute the command while the RStudio Connect service is running, but all of your content will be inaccessible (users will see a spinner with the message "rebuilding environment").

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.