Install Rstan fails

I have problems in installing RStan. I always get the following error:
" Installation des Pakets ‘rstan’ hatte Exit-Status ungleich 0"

I tried different commands, latest I used
install.packages(“rstan”, repos=“https://cloud.r-project.org/”, dependencies=TRUE)

I also tried the commands on the GitHub site of Rstan:

Add Michael Rutter’s c2d4u3.5 PPA (and rrutter3.5 for CRAN builds too)

sudo add-apt-repository -y “ppa:marutter/rrutter4.0”
sudo add-apt-repository -y “ppa:marutter/c2d4u3.5”
sudo apt update
sudo apt install r-cran-rstan

In this case, it always fails by "sudo add-apt-repository -y “ppa:marutter/c2d4u3.5"” :
bash: sudo add-apt-repository -y ppa:marutter/c2d4u3.5
sudo add-apt-repository -y ppa:marutter/c2d4u3.5: Datei oder Verzeichnis nicht gefunden
(In English it says that the file or directory was not found)

My system: Ubuntu 20.04LTS, R-Version 4.04

Best wishes, Marcel11

Have you tried removing rstan first and then follow along with this:

I am on Ubuntu 20 and when I upgraded to R 4.0 it was a nightmare trying to get rstan and other Stan related packages reinstalled.

1 Like

I tried using this with Ubuntu 21.04 but it returned these errors

ERROR: dependencies ‘rstan’, ‘threejs’ are not available for package ‘shinystan’
* removing ‘/usr/local/lib/R/site-library/shinystan’

The downloaded source packages are in
    ‘/tmp/RtmpC2hgX7/downloaded_packages’
Warning messages:
1: In install.packages("rstan", repos = "https://cloud.r-project.org/",  :
  installation of package ‘igraph’ had non-zero exit status
2: In install.packages("rstan", repos = "https://cloud.r-project.org/",  :
  installation of package ‘RcppEigen’ had non-zero exit status
3: In install.packages("rstan", repos = "https://cloud.r-project.org/",  :
  installation of package ‘StanHeaders’ had non-zero exit status
4: In install.packages("rstan", repos = "https://cloud.r-project.org/",  :
  installation of package ‘threejs’ had non-zero exit status
5: In install.packages("rstan", repos = "https://cloud.r-project.org/",  :
  installation of package ‘rstan’ had non-zero exit status
6: In install.packages("rstan", repos = "https://cloud.r-project.org/",  :
  installation of package ‘shinystan’ had non-zero exit status

I’ve updated the installation instructions for 21.04 and tested them in a clean docker image, can you try the instructions here: Configuring C Toolchain for Linux · stan-dev/rstan Wiki · GitHub and let me know if you run into any issues?

2 Likes

Much much thanks… Rstan is now installed!😃

1 Like