Closed pokyah closed 2 years ago
The geospatial packages are known tricky because of the libraries and build drift. If you can, consider 22.04 aka "jammy" which is better.
As for focal, I just did
edd@rob:~$ docker run --rm -ti eddelbuettel/r2u:20.04
root@df7a711744a4:/# install.r sf
Install system packages as root...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Ign https://r2u.stat.illinois.edu/ubuntu focal InRelease
Get:1 https://r2u.stat.illinois.edu/ubuntu focal Release [5713 B]
Get:2 https://r2u.stat.illinois.edu/ubuntu focal Release.gpg [793 B]
Get:3 https://r2u.stat.illinois.edu/ubuntu focal/main amd64 Packages [2147 kB]
Get:4 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu focal InRelease [18.1 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit http://archive.ubuntu.com/ubuntu focal InRelease
Get:6 https://r2u.stat.illinois.edu/ubuntu focal/main all Packages [6654 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:8 http://ppa.launchpad.net/edd/misc/ubuntu focal InRelease [18.1 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2139 kB]
Hit http://ppa.launchpad.net/edd/r-4.0/ubuntu focal InRelease
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [1654 kB]
Get:12 http://ppa.launchpad.net/marutter/rrutter4.0/ubuntu focal InRelease [17.5 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1200 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [903 kB]
Get:15 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu focal/main amd64 Packages [1060 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [30.2 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2631 kB]
Get:18 http://ppa.launchpad.net/edd/misc/ubuntu focal/main amd64 Packages [16.6 kB]
Get:19 http://ppa.launchpad.net/marutter/rrutter4.0/ubuntu focal/main amd64 Packages [8895 B]
Fetched 18.8 MB in 0s (0 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
Get:1 https://r2u.stat.illinois.edu/ubuntu focal/main amd64 r-cran-proxy amd64 0.4-27-1.ca2004.1 [169 kB]
Get:2 https://r2u.stat.illinois.edu/ubuntu focal/main amd64 r-cran-e1071 amd64 1.7-11-1.ca2004.1 [547 kB]
[.... lots of other lines omitted ...]
Setting up odbcinst (2.3.6-0.1build1) ...
Setting up libgdal26 (3.0.4+dfsg-1build3) ...
Setting up r-cran-sf (1.0-8-1.ca2004.1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
root@df7a711744a4:/#
root@df7a711744a4:/# R
R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(sf)
Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1; sf_use_s2() is TRUE
>
so I can only urge you to study the documentation more closely (maybe you missed pinning?) as this clearly works.
Just for added benefit, I see
root@df7a711744a4:/# apt-cache policy r-cran-sf
r-cran-sf:
Installed: 1.0-8-1.ca2004.1
Candidate: 1.0-8-1.ca2004.1
Version table:
*** 1.0-8-1.ca2004.1 700
700 https://r2u.stat.illinois.edu/ubuntu focal/main amd64 Packages
100 /var/lib/dpkg/status
1.0-7-1cran1.2004.0 500
500 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu focal/main amd64 Packages
0.8-0+dfsg-1ubuntu3 500
500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
root@df7a711744a4:/#
Thanks for your quick reply @eddelbuettel,
Okay. I've got it now. I had to add the following lines to my dockerfile :
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A1489FE2AB99A21A
RUN echo "deb [arch=amd64] https://r2u.stat.illinois.edu/ubuntu focal main" > /etc/apt/sources.list.d/cranapt.list
RUN apt update
Doing so the installation of sf from withing my container works out of the box.
best regards
Hi !
Thanks for this great piece of software. I'm using it to build a custom docker image to ensure a standard & reproducible working environment. So far I can configure my dockerfile to pre-install the required packages.
Everything works as expected and once I'm into my container I can also install new packages thanks to bpsm using
install.packages("<pkg_name>")
or directly from terminal usingsudo apt-get install r-cran-<pkg_name>
.However if I try to install package
sf
from my container I get an error :From your documentation I can see that there was an issue with sf and that it was solved :
But I don't see what should I do in order to allow sf to be installed?
Here is an excerpt of the dockerfile used to build the container:
and the session info from within my container :
Thanks for your support.
Best regards!