Cannot reinstall or run Stringr package

Viewed 138

I recently upgrade ubuntu from 18.04 to 20.04, so this is probably related...

My code requires me to have the stringr package and to use tidyverse. When I try to run require(stringr) and library(tidyverse) I receive these errors,

> require(stringr) # String manipulation
Loading required package: stringr
Error: package or namespace load failed for ‘stringr’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/stringi/libs/stringi.so':
  libicui18n.so.60: cannot open shared object file: No such file or directory
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/stringi/libs/stringi.so':
  libicui18n.so.60: cannot open shared object file: No such file or directory

I've tried reinstalling stringr using install.packages("stringr") but then get

Installing package into ‘/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/stringr_1.4.0.tar.gz'
Content type 'application/x-gzip' length 135777 bytes (132 KB)
==================================================
downloaded 132 KB

* installing *source* package ‘stringr’ ...
** package ‘stringr’ successfully unpacked and MD5 sums checked
mv: cannot move '/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/stringr' to '/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-stringr/stringr': Permission denied
ERROR: cannot remove earlier installation, is it in use?
* removing ‘/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/stringr’
Warning in install.packages :
  installation of package ‘stringr’ had non-zero exit status

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

Although it seems as if Stringr is good to go and all there, when I attempt to use require(stringr) I end up getting this error

Loading required package: stringr Error: package or namespace load failed for ‘stringr’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/stringi/libs/stringi.so': libicui18n.so.60: cannot open shared object file: No such file or directory

Any idea on how to handle this?

1 Answers

The second message seems to indicate that stringr was actually successfully installed. Try running again

require(stringr)
Related