Unable to install any package after upgrading to R 4.1.1

Hi, I am a fairly new user, I have a problem installing any package in RStudio, I had already had RStudio in a previous version in Ubuntu, what I did was to uninstall this version and install the latest, now I can not install any package, I have already looked at changing the mirrors but it still does not work. Here is attached what RStudio generates.

Installing package into ‘/home/edgardo/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘broom’, ‘dbplyr’, ‘dtplyr’, ‘googlesheets4’, ‘haven’, ‘modelr’, ‘readr’, ‘rvest’, ‘tidyr’

trying URL 'https://cloud.r-project.org/src/contrib/broom_0.7.9.tar.gz'
Content type 'application/x-gzip' length 631606 bytes (616 KB)
==================================================
downloaded 616 KB

trying URL 'https://cloud.r-project.org/src/contrib/dbplyr_2.1.1.tar.gz'
Content type 'application/x-gzip' length 581845 bytes (568 KB)
==================================================
downloaded 568 KB

trying URL 'https://cloud.r-project.org/src/contrib/dtplyr_1.1.0.tar.gz'
Content type 'application/x-gzip' length 111895 bytes (109 KB)
==================================================
downloaded 109 KB

trying URL 'https://cloud.r-project.org/src/contrib/googlesheets4_1.0.0.tar.gz'
Content type 'application/x-gzip' length 222038 bytes (216 KB)
==================================================
downloaded 216 KB

trying URL 'https://cloud.r-project.org/src/contrib/haven_2.4.3.tar.gz'
Content type 'application/x-gzip' length 296805 bytes (289 KB)
==================================================
downloaded 289 KB

trying URL 'https://cloud.r-project.org/src/contrib/modelr_0.1.8.tar.gz'
Content type 'application/x-gzip' length 121333 bytes (118 KB)
==================================================
downloaded 118 KB

trying URL 'https://cloud.r-project.org/src/contrib/readr_2.0.1.tar.gz'
Content type 'application/x-gzip' length 517944 bytes (505 KB)
==================================================
downloaded 505 KB

trying URL 'https://cloud.r-project.org/src/contrib/rvest_1.0.1.tar.gz'
Content type 'application/x-gzip' length 94307 bytes (92 KB)
==================================================
downloaded 92 KB

trying URL 'https://cloud.r-project.org/src/contrib/tidyr_1.1.3.tar.gz'
Content type 'application/x-gzip' length 707909 bytes (691 KB)
==================================================
downloaded 691 KB

trying URL 'https://cloud.r-project.org/src/contrib/tidyverse_1.3.1.tar.gz'
Content type 'application/x-gzip' length 702779 bytes (686 KB)
==================================================
downloaded 686 KB

* installing *source* package ‘dbplyr’ ...
** package ‘dbplyr’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (dbplyr)
* installing *source* package ‘dtplyr’ ...
** package ‘dtplyr’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (dtplyr)
* installing *source* package ‘googlesheets4’ ...
** package ‘googlesheets4’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (googlesheets4)
ERROR: failed to lock directory ‘/home/edgardo/R/x86_64-pc-linux-gnu-library/4.1’ for modifying
Try removing ‘/home/edgardo/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-readr’
Warning in install.packages :
  installation of package ‘readr’ had non-zero exit status
* installing *source* package ‘rvest’ ...
** package ‘rvest’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rvest)
* installing *source* package ‘tidyr’ ...
** package ‘tidyr’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/home/edgardo/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c cpp11.cpp -o cpp11.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/home/edgardo/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c fill.cpp -o fill.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/home/edgardo/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c melt.cpp -o melt.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/home/edgardo/R/x86_64-pc-linux-gnu-library/4.1/cpp11/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c simplifyPieces.cpp -o simplifyPieces.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o tidyr.so cpp11.o fill.o melt.o simplifyPieces.o -L/usr/lib/R/lib -lR
installing to /home/edgardo/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-tidyr/00new/tidyr/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading

Then this keeps repeating for a long time, but it never ends.

This is confusing, you are saying you can't install any package but the console output you are showing says the opposite, you have already installed a lot of packages and you only have problems with one (readr package), and the error message even tells you what to do.

Can you please clarify?

After removing '/home/edgardo/R/x86_64-pc-linux-gnu-library/4.1/00LOCK-readr' the problem was solved, that address was the one that was causing conflict to install packages. Thank you very much.

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.