Takes too long or fails to download after update

Hi, I have a problem when I try to download packages.
I recently updated my R studio, and since then it has either taken like 5 minutes to download a package, or it has given an error message.

Like, here is a small snippet of the problem I am getting. And I have no idea why:

trying URL [https://cran.rstudio.com/src/contrib/seminr_2.3.4.tar.gz](https://cran.rstudio.com/src/contrib/seminr_2.3.4.tar.gz)
Content type application/x-gzip length 1550277 bytes (1.5 MB)

downloaded 1.5 MB

ERROR: failed to lock directory ‘/Users/sebastianandersson/Library/R/x86_64/4.2/library’ for modifying
Try removing ‘/Users/sebastianandersson/Library/R/x86_64/4.2/library/00LOCK-igraph’
Warning in install.packages :
installation of package ‘igraph’ had non-zero exit status

  • installing source package ‘webp’ ...
    ** package ‘webp’ successfully unpacked and MD5 sums checked
    ** using staged installation
    Homebrew 4.3.3
    Using PKG_CFLAGS=-I/opt/homebrew/include
    Using PKG_LIBS=-L/opt/homebrew/lib -lwebp
    --------------------------- [ANTICONF] --------------------------------
    Configuration failed because libwebp was not found. Try installing:
  • deb: libwebp-dev (Debian, Ubuntu, etc)
  • rpm: libwebp-devel (Fedora, EPEL)
  • csw: libwebp_dev (Solaris)
  • brew: webp (OSX)
    If libwebp is already installed, check that pkg-config is in your
    PATH and PKG_CONFIG_PATH contains a libwebp.pc file. If pkg-config
    is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
    R CMD INSTALL --configure-vars=INCLUDE_DIR=... LIB_DIR=...
    -------------------------- [ERROR MESSAGE] ---------------------------
    :1:10: fatal error: webp/encode.h file not found
    1 | #include <webp/encode.h>
    | ^~~~~~~~~~~~~~~
    1 error generated.

ERROR: configuration failed for package ‘webp’

  • removing ‘/Users/sebastianandersson/Library/R/x86_64/4.2/library/webp’
    Warning in install.packages :
    installation of package ‘webp’ had non-zero exit status
    ERROR: dependency ‘igraph’ is not available for package ‘DiagrammeR’
  • removing ‘/Users/sebastianandersson/Library/R/x86_64/4.2/library/DiagrammeR’
    Warning in install.packages :
    installation of package ‘DiagrammeR’ had non-zero exit status
    ERROR: dependencies ‘DiagrammeR’, ‘webp’ are not available for package ‘seminr’
  • removing ‘/Users/sebastianandersson/Library/R/x86_64/4.2/library/seminr’
    Warning in install.packages :
    installation of package ‘seminr’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/bk/jfx52xk17bd2h_2rf5y3_8ym0000gn/T/RtmpUenGPV/downloaded_packages’

What operating system are you using?

I would suggest not to use homebrew to install R, because you'll have to compile all packages from source. CRAN's R build supports binary packages, with much faster and easier installation.

One good way to install CRAN's R build on macOS is the rig command line tool: GitHub - r-lib/rig: The R Installation Manager

Nevertheless, if you want to keep using homebrew's R then you'll need to install the required system packages with homebrew, e.g. in this case webp:

Hi, thank you for helping. I am using this system: Mac OS: Sequoia 15.3.2. (15.3.2 (24D81))

Hi, I have never used GitHub before. I have just opened the site, and I have literally no idea what is going on haha

No need to use GitHub, just read the documentation there, e.g. on installation: GitHub - r-lib/rig: The R Installation Manager