r Package Install Error ‘unable to move temporary installation’

When installing the ‘rgdal’ package I got the error

package ‘rgdal’ successfully unpacked and MD5 sums checked
Warning in install.packages :
unable to move temporary installation

It seems the antivirus software is delaying the install. The workaround is to slow it down by the following:

debug(utils:::unpackPkgZip)
install.packages(“packageName”)

Then just keep hitting the ‘Next’ button to execute the next line of code until the end.

Solution reference here.

The prior solution to change Sys.sleep(0.5) to Sys.sleep(2) will not work as sys.sleep variable doesn’t exist in the script.

Leave a comment