I am pretty desperate to install.packages("devtools").
However it allways fails with this error
Error: .onLoad failed in loadNamespace() for 'pkgload', details:
call: readRDS(nsInfoFilePath)
error: error reading from connection
Execution halted
ERROR: lazy loading failed for package ‘devtools’
* removing ‘/home/bjoern/R/x86_64-pc-linux-gnu-library/3.6/devtools’
Things I tried to fix this:
- Add the
dependencies = Targument - Following a suggestion by hadley wickham on github -> update rlang package
- Try to run
install.packages("pkgload")resulting in nearly exactly the same error (see below) - Completely removing R and reinstalling it
- Additionally installing package following packages:
- r-base-dev
- r-cran-devtools
- r-recommended
- Updated all packages update.packages(ask = FALSE, checkBuilt = TRUE)
Error of install.packages("pkgload")
Error: package or namespace load failed for ‘pkgload’:
.onLoad failed in loadNamespace() for 'pkgload', details:
call: readRDS(nsInfoFilePath)
error: error reading from connection
Error: loading failed
Execution halted
ERROR: loading failed
I digged even deeper to the pkgload (which at least I hope is the only reason for the problem). I will check if manually (re)installing all imports and suggests from the CRAN page of pkgload does solve it.
Imports: desc, methods, pkgbuild, rlang, rprojroot, rstudioapi, utils, withr
Suggests: bitops, covr, Rcpp, testthat
My
sessionInfo() output:
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=de_DE.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.3 tools_3.6.3
I still refuse to belief that it is impossibe to install devtools on ubuntu20
However at this point I take any straw
Solution Edit:
In short what fixed the issue for me was installing testthat package before. Thanks to comment by rui-barradas
install.packages("testthat")
install.packages("pkgload")
install.packages("devtools")
devtoolson Ubuntu 20.04 as I have it installed on 20.04! However, my R version is 4.0.0, so there might be some difference there. This seems like a potentially tough problem to debug. You may want to make sure there are no R packages installed (i.e., removingr-cran-devtoolsand any packages in your/home/user/R/folder), then start from justinstall.packages("pkgload")- duckmayrpkgloadwas installed I had to runinstall.packages('testthat'). - Rui Barradasapt-get install r-cran-devtools(after adding Michael Rutter's PPA to your repository list as per the Ubuntu-specific instructions on the CRAN site), does it work? That should be sufficient to install a binary version of the package (although I'd love to know why you're having trouble installing from source) - Ben Bolkerinstall.packages('testthat')before. Nowpkgloadworks as a charm and devtools was successfully installed as well. Looks like there is already an issue on github for this - Björn