Updating packages fails with error message: “Updating loaded packages”

I am getting an error when I try to update my R packages (via the Packages pane > Update but I don't think this matters). I haven't had this error before - it seems to have just invented itself recently to make my life difficult :slight_smile: I could update fine just a couple of days ago.

There's no real error message to help me work out what the issue is. This is what I see in the console:

> install.packages(c("blogdown", "bookdown", "geometry", "hms", "lpSolve", "pkgbuild", "rgl", "RgoogleMaps", "rmarkdown", "sys", "whisker", "zip"))
Error in install.packages : Updating loaded packages

[comes up with dialogue about restarting R to allow update]

Restarting R session...

> install.packages(c("blogdown", "bookdown", "geometry", "hms", "lpSolve", "pkgbuild", "rgl", "RgoogleMaps", "rmarkdown", "sys", "whisker", "zip"))

Restarting R session...

Error: Unable to establish connection with R session

I'm using RStudio, and have R 3.6.1 on 64-bit Windows 10.

I've done a Windows reboot and it's the same issue after doing that.

Any ideas please?

Does it work for you in R, but not in RStudio? (see FAQ below for disambiguation)

Thanks Mara.
I just opened up the RGui itself and pasted the install.packages line at the prompt and it worked smooth as you like. Weird.
So I'm not sure what the problem is with R within RStudio, maybe there's something affecting the R setup within the IDE that isn't to do with R itself. As I say, I have not had this problem before, it's suddenly started.

Very strange. I'm going to move this to the IDE category, and they can help you troubleshoot from there.

1 Like

The most likely culprit is that you are loading the packages that you're trying to reinstall in e.g. your .Rprofile, or you have R objects in your workspace that are forcing these packages to be reinstalled. See also:


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