0

I've tried installing from the repositories with no success. I've tried the solutions in this question thread. No luck. So I found the offending packages' zip files in my tmp folder, moved them to Downloads and tried installing them one-by-one, producing the same sort of errors: always ending with a non-zero exit status.

I looked on the github page for rstudio/blogdown and searched the rstudio community, but nothing seems quite the same. I hope this is a suitable place to post this problem.

In the suggested other questions at the bottom of this page, I found this question, and installed the list of lib libraries that suggested, but got the same errors when I restarted Rstudio and tried again.

tools/install packages/repository (CRAN)

> install.packages("blogdown")
Installing package into ‘/home/peter/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘httpuv’, ‘servr’

trying URL 'https://cloud.r-project.org/src/contrib/httpuv_1.6.11.tar.gz'
Content type 'application/x-gzip' length 1874829 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

trying URL 'https://cloud.r-project.org/src/contrib/servr_0.27.tar.gz'
Content type 'application/x-gzip' length 20898 bytes (20 KB)
==================================================
downloaded 20 KB

trying URL 'https://cloud.r-project.org/src/contrib/blogdown_1.18.tar.gz'
Content type 'application/x-gzip' length 104844 bytes (102 KB)
==================================================
downloaded 102 KB

* installing *source* package ‘httpuv’ ...
** package ‘httpuv’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -Ilibuv/include -pthread -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/later/include'   -fvisibility=hidden -DSTRICT_R_HEADERS -fpic  -g -O2 -ffile-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=/usr/src/r-base-4.2.2.20221110-2build1 -Wdate-time -D_FORTIFY_SOURCE=2  -c RcppExports-legacy.cpp -o RcppExports-legacy.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -Ilibuv/include -pthread -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/later/include'   -fvisibility=hidden -DSTRICT_R_HEADERS -fpic  -g -O2 -ffile-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=/usr/src/r-base-4.2.2.20221110-2build1 -Wdate-time -D_FORTIFY_SOURCE=2  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -Ilibuv/include -pthread -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/later/include'   -fvisibility=hidden -DSTRICT_R_HEADERS -fpic  -g -O2 -ffile-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=/usr/src/r-base-4.2.2.20221110-2build1 -Wdate-time -D_FORTIFY_SOURCE=2  -c callback.cpp -o callback.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -Ilibuv/include -pthread -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/later/include'   -fvisibility=hidden -DSTRICT_R_HEADERS -fpic  -g -O2 -ffile-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=/usr/src/r-base-4.2.2.20221110-2build1 -Wdate-time -D_FORTIFY_SOURCE=2  -c callbackqueue.cpp -o callbackqueue.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -Ilibuv/include -pthread -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/later/include'   -fvisibility=hidden -DSTRICT_R_HEADERS -fpic  -g -O2 -ffile-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=/usr/src/r-base-4.2.2.20221110-2build1 -Wdate-time -D_FORTIFY_SOURCE=2  -c filedatasource-unix.cpp -o filedatasource-unix.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -Ilibuv/include -pthread -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/later/include'   -fvisibility=hidden -DSTRICT_R_HEADERS -fpic  -g -O2 -ffile-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=/usr/src/r-base-4.2.2.20221110-2build1 -Wdate-time -D_FORTIFY_SOURCE=2  -c filedatasource-win.cpp -o filedatasource-win.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -Ilibuv/include -pthread -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/later/include'   -fvisibility=hidden -DSTRICT_R_HEADERS -fpic  -g -O2 -ffile-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=/usr/src/r-base-4.2.2.20221110-2build1 -Wdate-time -D_FORTIFY_SOURCE=2  -c fs.cpp -o fs.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -Ilibuv/include -pthread -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/peter/R/x86_64-pc-linux-gnu-library/4.2/later/include'   -fvisibility=hidden -DSTRICT_R_HEADERS -fpic  -g -O2 -ffile-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/build/r-base-VHKDZm/r-base-4.2.2.20221110=/usr/src/r-base-4.2.2.20221110-2build1 -Wdate-time -D_FORTIFY_SOURCE=2  -c gzipdatasource.cpp -o gzipdatasource.o
In file included from gzipdatasource.cpp:1:
gzipdatasource.h:4:10: fatal error: zlib.h: No such file or directory
    4 | #include <zlib.h>
      |          ^~~~~~~~
compilation terminated.
make: *** [/usr/lib/R/etc/Makeconf:178: gzipdatasource.o] Error 1
ERROR: compilation failed for package ‘httpuv’
* removing ‘/home/peter/R/x86_64-pc-linux-gnu-library/4.2/httpuv’
Warning in install.packages :
  installation of package ‘httpuv’ had non-zero exit status
ERROR: dependency ‘httpuv’ is not available for package ‘servr’
* removing ‘/home/peter/R/x86_64-pc-linux-gnu-library/4.2/servr’
Warning in install.packages :
  installation of package ‘servr’ had non-zero exit status
ERROR: dependencies ‘httpuv’, ‘servr’ are not available for package ‘blogdown’
* removing ‘/home/peter/R/x86_64-pc-linux-gnu-library/4.2/blogdown’
Warning in install.packages :
  installation of package ‘blogdown’ had non-zero exit status

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

then

tools/install packages/package archive file

install.packages("~/Downloads/blogdown_1.18.tar.gz", repos = NULL, type = "source")
Installing package into ‘/home/peter/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
ERROR: dependencies ‘httpuv’, ‘servr’ are not available for package ‘blogdown’
* removing ‘/home/peter/R/x86_64-pc-linux-gnu-library/4.2/blogdown’
Warning in install.packages :
  installation of package ‘/home/peter/Downloads/blogdown_1.18.tar.gz’ had non-zero exit status
  • 1
    If looks like you are missing a system dependency. What OS version are you using? Maybe try `sudo apt-get install libz-dev` outside of R at the command line to install the libz library and then try to install the package again – MrFlick Jun 26 '23 at 15:29
  • That's it!. Thank you. – user86874 Jun 26 '23 at 15:41
  • Welcome to StackOverflow. If you are on Ubuntu, consider [r2u](https://eddelbuettel.github.io/r2u/) which gives you _all_ of CRAN _as Ubuntu binaries_ you can install from R. I have given a few previous answers here at StackOverflow so a search will help. (Otherwise you will have to come to terms with compiling some packages from source: not that hard, but a little bit more work sometimes.) – Dirk Eddelbuettel Jun 26 '23 at 15:43

0 Answers0