See: https://docs.rstudio.com/connect/admin/cli.html#migration-cli
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.