When building Docker containers (or CI things for, like, GitHub) for #rstats, is there a way to know which apt-based packages you need to install beforehand? I always end up rebuilding, finding a new error, googling the name of the missing library, and repeating over and over until it builds and *surely* there's a better way??

@andrew
Maybe
apt-cache depends <pkg>?

Like:
> apt-cache depends r-base
>r-base
> Depends: r-base-core
> Depends: r-recommended
> Recommends: r-base-html
> Recommends: r-doc-html
> Suggests: elpa-ess
> |Suggests: r-doc-info
> Suggests: r-doc-pdf

For example (root required for `apt install`):

apt-cache depends r-base | grep 'Depends:' | awk '{print $2}' | xargs apt install

@andrew
Sorry I missread, you mean when installing r-packages.

Posit package manager might help. It tell you for each package and distro the install commands necessary for system dependencies.

https://packagemanager.posit.co/client/#/repos/cran/packages/overview?search=igraph

Posit Package Manager