Can't install package openssl while installing tidyverse package

While trying to install devtools, I supposedly upgrade my R version (to 4.3.1) through brew (don't know how. Maybe I entered some whole installer instructions).

Devtools couldn't be installed correctly and now I ended with no packages installed at all to use with my R (new) version.

In the middle, I updated XCode from the AppStore.

When I try to reinstall all the packages, I stumble across the installation of openssl with a non-zero exit status.

ld: warning: ignoring file /opt/homebrew/opt/openssl/lib/libssl.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/openssl/lib/libcrypto.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
installing to /usr/local/lib/R/4.3/site-library/00LOCK-openssl/00new/openssl/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘openssl’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/lib/R/4.3/site-library/00LOCK-openssl/00new/openssl/libs/openssl.so':
  dlopen(/usr/local/lib/R/4.3/site-library/00LOCK-openssl/00new/openssl/libs/openssl.so, 0x0006): symbol not found in flat namespace '_PKCS12_SAFEBAG_free'
Error: loading failed
Execution halted

This is my R Version

> R.version
               _                           
platform       x86_64-apple-darwin22.4.0   
arch           x86_64                      
os             darwin22.4.0                
system         x86_64, darwin22.4.0        
status                                     
major          4                           
minor          3.1                         
year           2023                        
month          06                          
day            16                          
svn rev        84548                       
language       R                           
version.string R version 4.3.1 (2023-06-16)
nickname       Beagle Scouts     

Any hints on what's going on?

Don't know how to uninstall the version and roll back to previous one that worked. Have 4.2 working for months with no problem and it's still in /usr/local/lib/R

juan:R/ $ ls -lra                                                                                   [23:17:07]
total 0
drwxr-xr-x@   12 juan  admin    384 Jun 21 13:47 share
drwxr-xr-x@    4 juan  admin    128 Jun 21 13:47 modules
drwxr-xr-x@   32 juan  admin   1024 Jun 21 13:47 library
drwxr-xr-x@    4 juan  admin    128 Jun 21 13:47 lib
drwxr-xr-x@   11 juan  admin    352 Jun 21 13:47 include
drwxr-xr-x@    7 juan  admin    224 Jun 21 13:47 etc
drwxr-xr-x@   23 juan  admin    736 Jun 21 13:47 doc
drwxr-xr-x@   26 juan  admin    832 Jun 21 13:47 bin
lrwxr-xr-x@    1 juan  admin     39 Jun 21 13:47 SVN-REVISION -> ../../Cellar/r/4.3.1/lib/R/SVN-REVISION
lrwxr-xr-x@    1 juan  admin     34 Jun 21 13:47 COPYING -> ../../Cellar/r/4.3.1/lib/R/COPYING
drwxr-xr-x@    3 juan  admin     96 Jun 21 13:47 4.3
drwxr-xr-x     3 juan  admin     96 May  7  2022 4.2
drwxr-xr-x     3 juan  admin     96 Aug 13  2020 4.0
drwxrwxr-x  1355 juan  admin  43360 Jun 21 14:37 ..
drwxr-xr-x    15 juan  admin    480 Jun 21 13:47 .

This is the Silicon chip (M1, M2). You are on an older Mac with Intel, so that is the problem. How did you ask brew to install OpenSSL?

My MAC is an M1.
I've installed openssl with brew

> brew install openssl@3

Maybe uninstalling all of it and installing again would help. But not sure how to start.

Sys.getenv gives me this:

> Sys.getenv("R_HOME")
[1] "/usr/local/Cellar/r/4.3.1/lib/R"

I might have some problems in my installation since I see some (possible) conflicts:


juan:R/ $ pwd                                                                                                            [8:46:02]
/usr/local/lib/R
juan:R/ $ ls -lra                                                                                                        [8:46:04]
total 0
drwxr-xr-x@   12 juan  admin    384 Jun 21 13:47 share
drwxr-xr-x@    4 juan  admin    128 Jun 21 13:47 modules
drwxr-xr-x@   32 juan  admin   1024 Jun 21 13:47 library
drwxr-xr-x@    4 juan  admin    128 Jun 21 13:47 lib
drwxr-xr-x@   11 juan  admin    352 Jun 21 13:47 include
drwxr-xr-x@    7 juan  admin    224 Jun 21 13:47 etc
drwxr-xr-x@   23 juan  admin    736 Jun 21 13:47 doc
drwxr-xr-x@   26 juan  admin    832 Jun 21 13:47 bin
lrwxr-xr-x@    1 juan  admin     39 Jun 21 13:47 SVN-REVISION -> ../../Cellar/r/4.3.1/lib/R/SVN-REVISION
lrwxr-xr-x@    1 juan  admin     34 Jun 21 13:47 COPYING -> ../../Cellar/r/4.3.1/lib/R/COPYING
drwxr-xr-x@    3 juan  admin     96 Jun 21 13:47 4.3
drwxr-xr-x     3 juan  admin     96 May  7  2022 4.2
drwxr-xr-x     3 juan  admin     96 Aug 13  2020 4.0
drwxrwxr-x  1355 juan  admin  43360 Jun 21 14:37 ..
drwxr-xr-x    15 juan  admin    480 Jun 21 13:47 .

but:

juan:Versions/ $ pwd                                                                   [8:46:53]
/Library/Frameworks/R.framework/Versions
juan:Versions/ $ ls -lra                                                               [8:46:54]
total 16
lrwxr-xr-x   1 root  wheel     3 Jan 11  2019 Current -> 3.3
drwxrwxr-x   7 root  wheel   224 Oct 12  2018 3.5
drwxrwxr-x   7 root  wheel   224 Jan 11  2019 3.3
drwxrwxr-x   3 root  wheel    96 Jul 18  2016 3.2
-rw-rw-r--@  1 root  wheel  6148 Oct 12  2018 .DS_Store
drwxrwxr-x  11 root  wheel   352 Jan 11  2019 ..
drwxrwxr-x   7 root  wheel   224 Jan 11  2019 .

Since it was difficult to find a smooth process to uninstall R version 4.3.1, because this conf has been up and running for quite a long time (migrated to this Mac from a previous intel processor), digging into /usr/local/lib/R/version-number/site-library/, I just copied the "problematic" package to the new version.

juan:bin/ $ cd /usr/local/lib/R/4.3/site-library                                      [11:55:18]
juan:site-library/ $ cp /usr/local/lib/R/4.2/site-library/openssl .

Doing this, openssl package worked. But if I try to install package "devtools", which was the initial action that triggered this whole mess, the same error appear while trying to install openssl (which is installed and working)

Strange behavior is still showing since RStudio tells me that some packages are required by a script file and not installed. But as you can see in the screenshot below, if I "library" those packages, they are installed and can be loaded...

Nevertheless, I rather clean up this whole mess soon, uninstalling everything and generating a new configuration for my computer.
I Don't know how to clean start. If anyone could give me a hand, It'll be appreciated.

Thanks

Don’t use brew to update R. Use the CRAN image instead after brew uninstall

1 Like

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.