library(msm) Error: package or namespace load failed for ‘msm’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/mnt/efs/home/ID.../R/x86_64-pc-linux-gnu-library/4.3/expm/libs/expm.so': libRlapack.so: cannot open shared obje

Hi,
I have been using the Posit Workbench. The msm package was properly installed. however, that is producing the following error while loding the package. Any suggestion would be highly appreciated. Thanks

library(msm)
Error: package or namespace load failed for ‘msm’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/mnt/efs/home/ID.../R/x86_64-pc-linux-gnu-library/4.3/expm/libs/expm.so':
libRlapack.so: cannot open shared object file: No such file or directory

Your expm installation is broken, possibly. How did you install that package? You can try to reinstall it.

Thanks for your response.
Tried to reinstall and here is the result

I think you are misreading @ Gabor's message. He thinks it is the {expm} package that is broken. {msm} is supposed to import it but that may not be working properly.

You may want to do an

install.packages("expm"}

before installing {msm}.

Thanks for clarifying!
Installing expm did not solve the problem either. Here is the sequence

What happens if you just do

library(expm)

I think the problem may be the lack of libRlapark.so I have this

> sessionInfo()
R version 4.5.0 (2025-04-11)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.12.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Toronto
tzcode source: system (glibc)

Which seeoms to indicade that ~libRlpack.so is installed.

What happens if you do a

sessionInfo()

Thanks!
The session info is somewhat different. Here it is.

Just different enough that I am not sure how to interpret it. but I do notice that you seem to have an older version of LAPACK installed v. 3.9.0 versus my v.3.12.0 which maybe making a difference.

I've never seen Amazon Linux so I am just guessing even more than usual but you might want to check to see if there is a newer version for your Linux.

BTW, can I ask you to paste code or output between

```

```

rather than doing screenshots? It, usually, makes your code more readable and, if need be, it is easy to copy and paste.

Seems like you are installing Linux binary packages from a custom repository, and some of these are not compatible with your R installation.

If you have access to a regular CRAN repo or source packages, then try to install expm from source. This will compile it against the libraries you actually have. E.g. this might work if you have access to the CRAN repo:

install.packages("expm", repos = c(CRAN = "https://cloud.r-project.org"))