I know it's a current question regarding the number of topics about this issue. However, I didn't find a suitable answer on the website. I'm a beginner on Linux, and while installing packages on R, I sometimes meet this problem. Here is my code:
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/Rvcg_0.19.1.tar.gz'
Content type 'application/x-gzip' length 1934965 bytes (1.8 MB)
==================================================
downloaded 1.8 MB
ERROR: failed to lock directory ‘/usr/local/lib/R/site-library’ for modifying
Try removing ‘/usr/local/lib/R/site-library/00LOCK-Rvcg’
The downloaded source packages are in
‘/tmp/RtmpKAVwlV/downloaded_packages’
Warning message:
In install.packages("Rvcg") :
installation of package ‘Rvcg’ had non-zero exit status
My version of Linux is Linux Mint 20.
Thanks for your help