error installing and updating packages: could not find function "setClassUnion"

Bioconductor version 3.15 (BiocManager 1.30.18), R 4.2.1 (2022-06-23)
RStudio 2022.07.1 Build 554

Dear support

I am experiencing recurrent issues installing and updating several packages recently (started after upgrading R to 4.2)
This includes "dbplyr", "dplyr", "SeuratObject", "tidytree" and the error is always something with functions that cannot be loaded

eg: tidytree

Error in setClassUnion("DNAbin_Or_AAbin", c("DNAbin", "AAbin", "NULL")) : 
  could not find function "setClassUnion"
Error: unable to load R code in package ‘tidytree’
Execution halted

Is this something RStudio support can help me fix?

Thanks in advance

Just to clarify, this is not RStudio's support, there is no customer support for the open source software just for the paid professional products. This is a community of users that help each other.

After a major R version update you need to update your package library to make sure packages are compiled for your current R version.

update.packages(checkBuilt = TRUE)

thanks a lot @andresrcs
I tried the command which indeed detects outdated versions but fails to upgrade them with the same error.

This is only occurring under ubuntu for me and the same packages are installed OK on my OSX laptop

> update.packages(checkBuilt = TRUE)
dplyr :
 Version 1.0.9 installed in /opt/R_LIBS built under R 4.2.0 
 Version 1.0.10 available at https://cloud.r-project.org
Update? (Yes/no/cancel) 
SeuratObject :
 Version 4.1.0 installed in /opt/R_LIBS built under R 4.2.0 
 Version 4.1.1 available at https://cloud.r-project.org
Update? (Yes/no/cancel) 
tidytree :
 Version 0.3.9 installed in /opt/R_LIBS built under R 4.2.0 
 Version 0.4.0 available at https://cloud.r-project.org
Update? (Yes/no/cancel) 
trying URL 'https://cloud.r-project.org/src/contrib/dplyr_1.0.10.tar.gz'
Content type 'application/x-gzip' length 884984 bytes (864 KB)

#### more failures

* installing *source* package ‘tidytree’ ...
** package ‘tidytree’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in setClassUnion("DNAbin_Or_AAbin", c("DNAbin", "AAbin", "NULL")) : 
  could not find function "setClassUnion"
Error: unable to load R code in package ‘tidytree’
Execution halted
ERROR: lazy loading failed for package ‘tidytree’
* removing ‘/opt/R_LIBS/tidytree’
* restoring previous ‘/opt/R_LIBS/tidytree’

The downloaded source packages are in
        ‘/opt/R_LIBS/tmp/RtmpXBsSdk/downloaded_packages’
Warning messages:
1: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘dplyr’ had non-zero exit status
2: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘SeuratObject’ had non-zero exit status
3: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘tidytree’ had non-zero exit status

I think we need more details, let's tackle each package individually, can you post the complete console output you get when you try to install dplyr?

install.packages("dplyr")

Thanks Andres for your kind help!

dplyr is already installed but outdated and upgrading fails (on this ubuntu machine)
here we go.

install.packages("dplyr")
trying URL 'https://cloud.r-project.org/src/contrib/dplyr_1.0.10.tar.gz'
Content type 'application/x-gzip' length 884984 bytes (864 KB)
==================================================
downloaded 864 KB

* installing *source* package ‘dplyr’ ...
** package ‘dplyr’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-zYgbYq/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c chop.cpp -o chop.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-zYgbYq/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c filter.cpp -o filter.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-zYgbYq/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c funs.cpp -o funs.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-zYgbYq/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c group_by.cpp -o group_by.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-zYgbYq/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c group_data.cpp -o group_data.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-zYgbYq/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c imports.cpp -o imports.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-zYgbYq/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c init.cpp -o init.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-zYgbYq/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c mask.cpp -o mask.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-zYgbYq/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c mutate.cpp -o mutate.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-zYgbYq/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c slice.cpp -o slice.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-zYgbYq/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c summarise.cpp -o summarise.o
g++ -std=gnu++14 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o dplyr.so chop.o filter.o funs.o group_by.o group_data.o imports.o init.o mask.o mutate.o slice.o summarise.o -L/usr/lib/R/lib -lR
installing to /opt/R_LIBS/00LOCK-dplyr/00new/dplyr/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in setOldClass(c("grouped_df", "tbl_df", "tbl", "data.frame")) : 
  could not find function "setOldClass"
Error: unable to load R code in package ‘dplyr’
Execution halted
ERROR: lazy loading failed for package ‘dplyr’
* removing ‘/opt/R_LIBS/dplyr’
* restoring previous ‘/opt/R_LIBS/dplyr’

The downloaded source packages are in
	‘/opt/R_LIBS/tmp/Rtmp4QyJAP/downloaded_packages’
Warning message:
In install.packages("dplyr") :
  installation of package ‘dplyr’ had non-zero exit status

This is a base R function, maybe your base R package library has get corrupted for some reason, I would try with a clean R install, including the package library.

Also, it seems you are pointing your default package library to a custom location, make sure your libPaths also point to the base R package library at R_HOME (the installation folder).

I did that normally

to check for this, I removed R_LIBS redirections from all my configs and deinstalled R from my machine using sudo apt remove r-base-core r-base

I then reinstalled with sudo apt install r-base r-base-dev and it seemed to work but when I tried installing dplyr, it failed complaining about missing files in /usr/lib/R/etc/

It seems that the current installer (4.2.1-2.2004.0) did not create some extra files in /etc/R/ and the fresh symlinks in /usr/lib/R/etc/ are broken

Could it be that the latest R installer is not doing its job OK?

here is my /usr/lib/etc after clean install

 $ ll /usr/lib/R/etc/
total 16K
drwxr-xr-x 2 root root 4.0K Sep  6 10:24 .
drwxr-xr-x 8 root root 4.0K Sep  6 10:24 ..
-rw-r--r-- 1 root root  234 Aug 11 02:31 javaconf
lrwxrwxrwx 1 root root   14 Aug 11 02:31 ldpaths -> /etc/R/ldpaths
lrwxrwxrwx 1 root root   15 Aug 11 02:31 Makeconf -> /etc/R/Makeconf
lrwxrwxrwx 1 root root   15 Aug 11 02:31 Renviron -> /etc/R/Renviron
lrwxrwxrwx 1 root root   20 Aug 11 02:31 Renviron.site -> /etc/R/Renviron.site
-rw-r--r-- 1 root root 1.9K Aug 11 02:31 Renviron.ucf
lrwxrwxrwx 1 root root   19 Aug 11 02:31 repositories -> /etc/R/repositories
lrwxrwxrwx 1 root root   20 Aug 11 02:31 Rprofile.site -> /etc/R/Rprofile.site

and in my /etc/R/ I have only one file

$ ll /etc/R/

total 20K

drwxr-xr-x 2 root root 4.0K Sep 6 10:24 **.**

drwxr-xr-x 187 root root 12K Sep 6 10:24 **..**

-rw-r--r-- 1 root root 1.9K Sep 6 10:24 Renviron

note: I chose my national repo (Belgium:7) during fresh install

log of the failed dplyr install

$ sudo R

/usr/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"

Copyright (C) 2022 The R Foundation for Statistical Computing

Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.

You are welcome to redistribute it under certain conditions.

Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.

Type 'contributors()' for more information and

'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or

'help.start()' for an HTML browser interface to help.

Type 'q()' to quit R.

> install.packages("dplyr")

Installing package into ‘/usr/lib/R/site-library’

(as ‘lib’ is unspecified)

--- Please select a CRAN mirror for use in this session ---

X11 connection rejected because of wrong authentication.

Secure CRAN mirrors

1: 0-Cloud [https]

2: Australia (Canberra) [https]

3: Australia (Melbourne 1) [https]

4: Australia (Melbourne 2) [https]

5: Australia (Perth) [https]

6: Austria [https]

7: Belgium (Brussels) [https]

8: Brazil (PR) [https]

9: Brazil (RJ) [https]

10: Brazil (SP 1) [https]

11: Brazil (SP 2) [https]

12: Bulgaria [https]

13: Canada (MB) [https]

14: Canada (ON 3) [https]

15: Chile (Santiago) [https]

16: China (Beijing 2) [https]

17: China (Beijing 3) [https]

18: China (Hefei) [https]

19: China (Hong Kong) [https]

20: China (Guangzhou) [https]

21: China (Lanzhou) [https]

22: China (Nanjing) [https]

23: China (Shanghai 2) [https]

24: China (Shenzhen) [https]

25: Colombia (Cali) [https]

26: Costa Rica [https]

27: Cyprus [https]

28: Czech Republic [https]

29: Denmark [https]

30: East Asia [https]

31: Ecuador (Cuenca) [https]

32: Ecuador (Quito) [https]

33: France (Lyon 1) [https]

34: France (Lyon 2) [https]

35: France (Marseille) [https]

36: France (Paris 1) [https]

37: Germany (Erlangen) [https]

38: Germany (Leipzig) [https]

39: Germany (Göttingen) [https]

40: Germany (Münster) [https]

41: Germany (Regensburg) [https]

42: Greece [https]

43: Hungary [https]

44: Iceland [https]

45: India [https]

46: Indonesia (Banda Aceh) [https]

47: Iran (Mashhad) [https]

48: Italy (Milano) [https]

49: Italy (Padua) [https]

50: Japan (Tokyo) [https]

51: Japan (Yonezawa) [https]

52: Korea (Gyeongsan-si) [https]

53: Korea (Seoul 1) [https]

54: Korea (Ulsan) [https]

55: Malaysia [https]

56: Mexico (Mexico City) [https]

57: Mexico (Texcoco) [https]

58: Morocco [https]

59: Netherlands (Dronten) [https]

60: New Zealand [https]

61: Norway [https]

62: South Africa (Johannesburg) [https]

63: Spain (A Coruña) [https]

64: Spain (Madrid) [https]

65: Sweden (Borås) [https]

66: Sweden (Umeå) [https]

67: Switzerland [https]

68: Taiwan (Taipei) [https]

69: Turkey (Denizli) [https]

70: Turkey (Istanbul) [https]

71: Turkey (Mersin) [https]

72: UK (Bristol) [https]

73: UK (London 1) [https]

74: USA (IA) [https]

75: USA (MI) [https]

76: USA (OH) [https]

77: USA (OR) [https]

78: USA (TN) [https]

79: USA (TX 1) [https]

80: Uruguay [https]

81: (other mirrors)

Selection: 7

also installing the dependencies ‘fansi’, ‘pkgconfig’, ‘ellipsis’, ‘purrr’, ‘cli’, ‘utf8’, ‘generics’, ‘glue’, ‘lifecycle’, ‘magrittr’, ‘R6’, ‘rlang’, ‘tibble’, ‘tidyselect’, ‘vctrs’, ‘pillar’

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/fansi_1.0.3.tar.gz'

Content type 'application/octet-stream' length 481163 bytes (469 KB)

==================================================

downloaded 469 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/pkgconfig_2.0.3.tar.gz'

Content type 'application/octet-stream' length 6080 bytes

==================================================

downloaded 6080 bytes

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/ellipsis_0.3.2.tar.gz'

Content type 'application/octet-stream' length 8066 bytes

==================================================

downloaded 8066 bytes

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/purrr_0.3.4.tar.gz'

Content type 'application/octet-stream' length 375062 bytes (366 KB)

==================================================

downloaded 366 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/cli_3.3.0.tar.gz'

Content type 'application/octet-stream' length 495823 bytes (484 KB)

==================================================

downloaded 484 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/utf8_1.2.2.tar.gz'

Content type 'application/octet-stream' length 240327 bytes (234 KB)

==================================================

downloaded 234 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/generics_0.1.3.tar.gz'

Content type 'application/octet-stream' length 172201 bytes (168 KB)

==================================================

downloaded 168 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/glue_1.6.2.tar.gz'

Content type 'application/octet-stream' length 106510 bytes (104 KB)

==================================================

downloaded 104 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/lifecycle_1.0.1.tar.gz'

Content type 'application/octet-stream' length 99716 bytes (97 KB)

==================================================

downloaded 97 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/magrittr_2.0.3.tar.gz'

Content type 'application/octet-stream' length 267074 bytes (260 KB)

==================================================

downloaded 260 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/R6_2.5.1.tar.gz'

Content type 'application/octet-stream' length 63422 bytes (61 KB)

==================================================

downloaded 61 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/rlang_1.0.5.tar.gz'

Content type 'application/octet-stream' length 741683 bytes (724 KB)

==================================================

downloaded 724 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/tibble_3.1.8.tar.gz'

Content type 'application/octet-stream' length 672336 bytes (656 KB)

==================================================

downloaded 656 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/tidyselect_1.1.2.tar.gz'

Content type 'application/octet-stream' length 92085 bytes (89 KB)

==================================================

downloaded 89 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/vctrs_0.4.1.tar.gz'

Content type 'application/octet-stream' length 916782 bytes (895 KB)

==================================================

downloaded 895 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/pillar_1.8.1.tar.gz'

Content type 'application/octet-stream' length 479977 bytes (468 KB)

==================================================

downloaded 468 KB

trying URL 'https://ftp.belnet.be/mirror/CRAN/src/contrib/dplyr_1.0.10.tar.gz'

Content type 'application/octet-stream' length 884984 bytes (864 KB)

==================================================

downloaded 864 KB

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory

/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory

Error in file(con, "r") : cannot open the connection

Calls: <Anonymous> ... is.factor -> grep -> is.factor -> readLines -> file

In addition: Warning message:

In file(con, "r") :

cannot open file '/usr/lib/R/etc/Makeconf': No such file or directory

The downloaded source packages are in

‘/tmp/RtmpUR6rnw/downloaded_packages’

There were 17 warnings (use warnings() to see them)

> warnings()

Warning messages:

1: In install.packages("dplyr") :

installation of package ‘fansi’ had non-zero exit status

2: In install.packages("dplyr") :

installation of package ‘pkgconfig’ had non-zero exit status

3: In install.packages("dplyr") :

installation of package ‘utf8’ had non-zero exit status

4: In install.packages("dplyr") :

installation of package ‘generics’ had non-zero exit status

5: In install.packages("dplyr") :

installation of package ‘glue’ had non-zero exit status

6: In install.packages("dplyr") :

installation of package ‘magrittr’ had non-zero exit status

7: In install.packages("dplyr") :

installation of package ‘R6’ had non-zero exit status

8: In install.packages("dplyr") :

installation of package ‘rlang’ had non-zero exit status

9: In install.packages("dplyr") :

installation of package ‘ellipsis’ had non-zero exit status

10: In install.packages("dplyr") :

installation of package ‘purrr’ had non-zero exit status

11: In install.packages("dplyr") :

installation of package ‘cli’ had non-zero exit status

12: In install.packages("dplyr") :

installation of package ‘lifecycle’ had non-zero exit status

13: In install.packages("dplyr") :

installation of package ‘vctrs’ had non-zero exit status

14: In install.packages("dplyr") :

installation of package ‘tidyselect’ had non-zero exit status

15: In install.packages("dplyr") :

installation of package ‘pillar’ had non-zero exit status

16: In install.packages("dplyr") :

installation of package ‘tibble’ had non-zero exit status

17: In install.packages("dplyr") :

installation of package ‘dplyr’ had non-zero exit status

The problem is definitely a corrupted R installation, but as long as you are using the official CRAN deb repository it is unlikely that the installer is faulty, otherwise it would be affecting a lot more people.

Sadly, I'm not sure how to solve this because I don't understand what could be causing it, try using sudo apt purge r-base r-base-dev (instead of remove) to eliminate the old configuration files.

1 Like

Thanks Andres,
I think you pinpointed it.

I apparently patched the problem by copying the content of the missing /etc/R/ files from a docker temporary install and now all packages are installing.

when something blocks, I will definitely do the apt purge as you proposed, hopefully this will return my system to a more pristine state.

Thanks a lot for your time and efforts to help me through this case, really appreciated

This topic was automatically closed 7 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.