Cannot install any packages - "non-zero exit status"

Hello,
I've been using RStudio for only a few weeks and at first everything was going fine. But last week I had to format my laptop and now I can't install any packages.

(I used Windows 8, now its Linux Mint 19.3. And my version of RStudio is 1.2.5033).

I get tons of error messages, like "Warning in install.packages : installation of package ‘tibble’ had non-zero exit status". In the end, it says "The downloaded source packages are in ‘/tmp/RtmpoKYSPa/downloaded_packages’" (the complete output is copyed below)

It happens not only with "readr" but with every package I try to install.

Can anybody help me?

Here is the complete console output I get with readr specifically:


> install.packages("readr")
Installing package into ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘glue’, ‘utf8’, ‘ellipsis’, ‘digest’, ‘cli’, ‘fansi’, ‘pillar’, ‘rlang’, ‘vctrs’, ‘Rcpp’, ‘tibble’, ‘hms’

tentando a URL 'https://cloud.r-project.org/src/contrib/glue_1.3.1.tar.gz'
Content type 'application/x-gzip' length 122950 bytes (120 KB)
==================================================
downloaded 120 KB

tentando a URL 'https://cloud.r-project.org/src/contrib/utf8_1.1.4.tar.gz'
Content type 'application/x-gzip' length 218882 bytes (213 KB)
==================================================
downloaded 213 KB

tentando a URL 'https://cloud.r-project.org/src/contrib/ellipsis_0.3.0.tar.gz'
Content type 'application/x-gzip' length 7371 bytes
==================================================
downloaded 7371 bytes

tentando a URL 'https://cloud.r-project.org/src/contrib/digest_0.6.24.tar.gz'
Content type 'application/x-gzip' length 145526 bytes (142 KB)
==================================================
downloaded 142 KB

tentando a URL 'https://cloud.r-project.org/src/contrib/cli_2.0.1.tar.gz'
Content type 'application/x-gzip' length 111914 bytes (109 KB)
==================================================
downloaded 109 KB

tentando a URL 'https://cloud.r-project.org/src/contrib/fansi_0.4.1.tar.gz'
Content type 'application/x-gzip' length 270906 bytes (264 KB)
==================================================
downloaded 264 KB

tentando a URL 'https://cloud.r-project.org/src/contrib/pillar_1.4.3.tar.gz'
Content type 'application/x-gzip' length 230874 bytes (225 KB)
==================================================
downloaded 225 KB

tentando a URL 'https://cloud.r-project.org/src/contrib/rlang_0.4.4.tar.gz'
Content type 'application/x-gzip' length 813413 bytes (794 KB)
==================================================
downloaded 794 KB

tentando a URL 'https://cloud.r-project.org/src/contrib/vctrs_0.2.2.tar.gz'
Content type 'application/x-gzip' length 721926 bytes (705 KB)
==================================================
downloaded 705 KB

tentando a URL 'https://cloud.r-project.org/src/contrib/Rcpp_1.0.3.tar.gz'
Content type 'application/x-gzip' length 2749025 bytes (2.6 MB)
==================================================
downloaded 2.6 MB

tentando a URL 'https://cloud.r-project.org/src/contrib/tibble_2.1.3.tar.gz'
Content type 'application/x-gzip' length 310774 bytes (303 KB)
==================================================
downloaded 303 KB

tentando a URL 'https://cloud.r-project.org/src/contrib/hms_0.5.3.tar.gz'
Content type 'application/x-gzip' length 134669 bytes (131 KB)
==================================================
downloaded 131 KB

tentando a URL 'https://cloud.r-project.org/src/contrib/readr_1.3.1.tar.gz'
Content type 'application/x-gzip' length 268853 bytes (262 KB)
==================================================
downloaded 262 KB

* installing *source* package ‘glue’ ...
** package ‘glue’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c glue.c -o glue.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c trim.c -o trim.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o glue.so glue.o init.o trim.o -L/usr/lib/R/lib -lR
/bin/bash: linha 2: g++: comando não encontrado
/usr/share/R/share/make/shlib.mk:6: recipe for target 'glue.so' failed
make: *** [glue.so] Error 127
ERROR: compilation failed for package ‘glue’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/glue’
Warning in install.packages :
  installation of package ‘glue’ had non-zero exit status
* installing *source* package ‘utf8’ ...
** package ‘utf8’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c as_utf8.c -o as_utf8.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c bytes.c -o bytes.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c context.c -o context.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c render.c -o render.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c render_table.c -o render_table.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c string.c -o string.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c text.c -o text.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8_encode.c -o utf8_encode.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8_format.c -o utf8_format.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8_normalize.c -o utf8_normalize.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8_valid.c -o utf8_valid.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8_width.c -o utf8_width.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c util.c -o util.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/array.c -o utf8lite/src/array.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/char.c -o utf8lite/src/char.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/encode.c -o utf8lite/src/encode.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/error.c -o utf8lite/src/error.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/escape.c -o utf8lite/src/escape.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/graph.c -o utf8lite/src/graph.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/graphscan.c -o utf8lite/src/graphscan.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/normalize.c -o utf8lite/src/normalize.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/render.c -o utf8lite/src/render.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/text.c -o utf8lite/src/text.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/textassign.c -o utf8lite/src/textassign.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/textiter.c -o utf8lite/src/textiter.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -Iutf8lite/src -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8lite/src/textmap.c -o utf8lite/src/textmap.o
ar rcs libcutf8lite.a utf8lite/src/array.o utf8lite/src/char.o utf8lite/src/encode.o utf8lite/src/error.o utf8lite/src/escape.o utf8lite/src/graph.o utf8lite/src/graphscan.o utf8lite/src/normalize.o utf8lite/src/render.o utf8lite/src/text.o utf8lite/src/textassign.o utf8lite/src/textiter.o utf8lite/src/textmap.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o utf8.so as_utf8.o bytes.o context.o init.o render.o render_table.o string.o text.o utf8_encode.o utf8_format.o utf8_normalize.o utf8_valid.o utf8_width.o util.o -L. -lcutf8lite -L/usr/lib/R/lib -lR
/bin/bash: linha 2: g++: comando não encontrado
/usr/share/R/share/make/shlib.mk:6: recipe for target 'utf8.so' failed
make: *** [utf8.so] Error 127
ERROR: compilation failed for package ‘utf8’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/utf8’
Warning in install.packages :
  installation of package ‘utf8’ had non-zero exit status
* installing *source* package ‘digest’ ...
** package ‘digest’ successfully unpacked and MD5 sums checked
** libs
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c SpookyV2.cpp -o SpookyV2.o
/bin/bash: g++: comando não encontrado
/usr/lib/R/etc/Makeconf:168: recipe for target 'SpookyV2.o' failed
make: *** [SpookyV2.o] Error 127
ERROR: compilation failed for package ‘digest’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/digest’
Warning in install.packages :
  installation of package ‘digest’ had non-zero exit status
* installing *source* package ‘fansi’ ...
** package ‘fansi’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c assumptions.c -o assumptions.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c has.c -o has.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c nchar.c -o nchar.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c read.c -o read.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c rnchar.c -o rnchar.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c state.c -o state.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c strip.c -o strip.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c strsplit.c -o strsplit.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c tabs.c -o tabs.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c tohtml.c -o tohtml.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c unhandled.c -o unhandled.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c unique.c -o unique.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utf8.c -o utf8.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c utils.c -o utils.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c wrap.c -o wrap.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o fansi.so assumptions.o has.o init.o nchar.o read.o rnchar.o state.o strip.o strsplit.o tabs.o tohtml.o unhandled.o unique.o utf8.o utils.o wrap.o -L/usr/lib/R/lib -lR
/bin/bash: linha 2: g++: comando não encontrado
/usr/share/R/share/make/shlib.mk:6: recipe for target 'fansi.so' failed
make: *** [fansi.so] Error 127
ERROR: compilation failed for package ‘fansi’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/fansi’
Warning in install.packages :
  installation of package ‘fansi’ had non-zero exit status
* installing *source* package ‘rlang’ ...
** package ‘rlang’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I./lib/     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c capture.c -o capture.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I./lib/     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c export.c -o export.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I./lib/     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c internal.c -o internal.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I./lib/     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c lib.c -o lib.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o rlang.so capture.o export.o internal.o lib.o -L/usr/lib/R/lib -lR
/bin/bash: linha 2: g++: comando não encontrado
/usr/share/R/share/make/shlib.mk:6: recipe for target 'rlang.so' failed
make: *** [rlang.so] Error 127
ERROR: compilation failed for package ‘rlang’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/rlang’
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
g++  -I/usr/share/R/include -DNDEBUG -I../inst/include/     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c api.cpp -o api.o
/bin/bash: g++: comando não encontrado
/usr/lib/R/etc/Makeconf:168: recipe for target 'api.o' failed
make: *** [api.o] Error 127
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/Rcpp’
Warning in install.packages :
  installation of package ‘Rcpp’ had non-zero exit status
ERROR: dependency ‘rlang’ is not available for package ‘ellipsis’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/ellipsis’
Warning in install.packages :
  installation of package ‘ellipsis’ had non-zero exit status
ERROR: dependencies ‘glue’, ‘fansi’ are not available for package ‘cli’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/cli’
Warning in install.packages :
  installation of package ‘cli’ had non-zero exit status
ERROR: dependencies ‘ellipsis’, ‘digest’, ‘glue’, ‘rlang’ are not available for package ‘vctrs’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/vctrs’
Warning in install.packages :
  installation of package ‘vctrs’ had non-zero exit status
ERROR: dependencies ‘cli’, ‘fansi’, ‘rlang’, ‘utf8’, ‘vctrs’ are not available for package ‘pillar’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/pillar’
Warning in install.packages :
  installation of package ‘pillar’ had non-zero exit status
ERROR: dependencies ‘rlang’, ‘vctrs’ are not available for package ‘hms’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/hms’
Warning in install.packages :
  installation of package ‘hms’ had non-zero exit status
ERROR: dependencies ‘cli’, ‘fansi’, ‘pillar’, ‘rlang’ are not available for package ‘tibble’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/tibble’
Warning in install.packages :
  installation of package ‘tibble’ had non-zero exit status
ERROR: dependencies ‘Rcpp’, ‘tibble’, ‘hms’ are not available for package ‘readr’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/readr’
Warning in install.packages :
  installation of package ‘readr’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmpoKYSPa/downloaded_packages’
> 
> library(readr)
Error in library(readr) : there is no package called ‘readr’
> 

I believe, this is the crux of your issue. It's difficult to diagnose without access to your machine, but it looks like you don't have compiler that is set up correctly, so when R tries to compile packages, it fails. I'm not that familiar with Mint, but you can probably google for this specific error to get to solution.

1 Like

I agree with Misha, most likely the gcc version is not compatible.

1 Like

Its worth thinking whether you wish to compile from source for the latest possible version, or whether you would be ok to install the most recent available precompiled binary (which therefore wont need you to fix compiler issues)

2 Likes

Not sure it's possible with Linux without additional setup. Or at least I don't know how :slight_smile:. With Windows for sure it makes more sense to go with pre-built binaries in vast majority of cases.

3 Likes

Thank you...
The problem is I'm terribly new at this and didn't quite understand the suggestions :sweat_smile:

"compile from source" would be dowlnoad RStudio again using this?

And how can I install the most recent available precompiled binary?
Sorry for the stupid questions :confused:

No, we are talking about packages not RStudio

This is almost not possible to do on Linux environments (there are paid solutions for this but I don't know of an open source way to do it).

Your best chance is to try to install a gcc version that is compatible with R

Try installing this in your system (from a terminal, not from R)

sudo apt-get install g++
1 Like

Thanks! I installed it from the synaptic package manager (saw this tip at an old topic at Linux Mint forum just before seeing your answer) and thought it had solved the problem, but ...
Well, I managed to download some packages (readr, dplyr), but when I tried data.table, another error came:

(is it possible that it didn't go well because I didn't install it from the terminal?)

> install.packages("data.table")
Installing package into ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
tentando a URL 'https://cloud.r-project.org/src/contrib/data.table_1.12.8.tar.gz'
Content type 'application/x-gzip' length 4948391 bytes (4.7 MB)
==================================================
  downloaded 4.7 MB

* installing *source* package ‘data.table’ ...
** package ‘data.table’ successfully unpacked and MD5 sums checked
*** pkg-config is installed but 'pkg-config --exists zlib' did not return 0.
*** Compilation will now be attempted and if it works you can ignore this message. However,
*** if compilation fails, try 'locate zlib.h zconf.h' and ensure the zlib development library
*** is installed :
  ***   deb: zlib1g-dev (Debian, Ubuntu, ...)
***   rpm: zlib-devel (Fedora, EPEL, ...)
***   brew: zlib (OSX)
*** Note that zlib is required to compile R itself so you may find the advice in the R-admin
*** guide helpful regarding zlib. On Debian/Ubuntu, zlib1g-dev is a dependency of r-base as
*** shown by 'apt-cache showsrc r-base | grep ^Build-Depends | grep zlib', and therefore
*** 'sudo apt-get build-dep r-base' should be sufficient too.
*** To silence this message, please ensure that :
  ***   1) 'pkg-config --exists zlib' succeeds (i.e. $? -eq 0)
***   2) 'pkg-config --libs zlib' contains -lz
*** Compilation will now be attempted ...
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c assign.c -o assign.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c between.c -o between.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c bmerge.c -o bmerge.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c chmatch.c -o chmatch.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c cj.c -o cj.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c coalesce.c -o coalesce.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c dogroups.c -o dogroups.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c fastmean.c -o fastmean.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c fcast.c -o fcast.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c fifelse.c -o fifelse.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c fmelt.c -o fmelt.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c forder.c -o forder.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c frank.c -o frank.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c fread.c -o fread.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c freadR.c -o freadR.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c froll.c -o froll.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c frollR.c -o frollR.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c frolladaptive.c -o frolladaptive.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c fsort.c -o fsort.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c fwrite.c -o fwrite.o
fwrite.c:10:10: fatal error: zlib.h: Arquivo ou diretório inexistente
#include <zlib.h>      // for compression to .gz
^~~~~~~~
  compilation terminated.
/usr/lib/R/etc/Makeconf:159: recipe for target 'fwrite.o' failed
make: *** [fwrite.o] Error 1
ERROR: compilation failed for package ‘data.table’
* removing ‘/home/raquel/R/x86_64-pc-linux-gnu-library/3.4/data.table’
Warning in install.packages :
  installation of package ‘data.table’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpImMZRp/downloaded_packages’

It's yet another system dependency that is missing from your installation. Try installing it and then installing data.table again.

1 Like

Thanks again! It works fine now.

1 Like

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