robjhyndman / forecast

Forecasting Functions for Time Series and Linear Models
http://pkg.robjhyndman.com/forecast
1.1k stars 340 forks source link

Cannot install forecast package in Docker #931

Closed mrtkp9993 closed 1 year ago

mrtkp9993 commented 1 year ago

I installed R in Docker with following Dockerfile commands:

RUN apt-get update && apt-get upgrade 
RUN apt-get install -y --no-install-recommends software-properties-common dirmngr wget gnupg
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-key '95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7'
RUN apt-add-repository 'deb http://cloud.r-project.org/bin/linux/debian bullseye-cran40/'
RUN apt-get install -y --no-install-recommends openssl libcurl4-openssl-dev libxml2-dev libgomp1 libopenblas-base r-base r-base-dev r-recommended && apt-get clean && rm -rf /var/lib/apt/lists/*

Then I am trying to install forecast package with following command:

install.packages("forecast", "/usr/local/lib/R/site-library", dependencies = TRUE, ask = FALSE, repos = "https://cran.r-project.org")
RUN Rscript install_r_deps.R

It fails for following dependencies:

image

robjhyndman commented 1 year ago

Since you are using a Debian OS, it would be simpler to use the packaged binaries as per https://eddelbuettel.github.io/r2u/ rather than build packages locally. Many packages have some system requirements, and you need to install these requirements first. But if you install the packaged binaries, the dependencies are taken care of.

mrtkp9993 commented 1 year ago

@robjhyndman Thanks for the answer! I was not aware of r2u, it will definitely get my job easier.