Easy way to re install all packages after updating R - statnet/computing GitHub Wiki
This example is based on updating from a Windows machine. You can modify as needed for your environment.
lib_loc <- "~/R/win-library/3.6" # modify with your old library path
to_install <- unname(installed.packages(lib.loc = lib_loc)[, "Package"]) # makes a list of your packages
to_install # look at the list
install.packages(pkgs = to_install) # re-install for the current version of R