我正在一个也包含 RShiny 的 docker 容器中安装 rgdal。我需要一些特定的库来安装一些软件包,但也需要 gdal 库的降级版本。我找到了一个解决方案:
aptitude install libgdal-dev libgdal1-dev libproj-dev libgdal1h libdap-dev
它提供了一个解决方案:
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) libdap-dev [Not Installed]
2) libdapserver7 [Not Installed]
3) libgdal-dev [Not Installed]
4) libgdal1-dev [Not Installed]
5) libgdal1h [Not Installed]
Accept this solution? [Y/n/q/?]
这不会安装任何东西,所以我回答它n
,并提供第二种选择:
Downgrade the following packages:
6) build-essential [12.1 (now, unstable) -> 11.7 (stable)]
7) g++ [4:5.2.1-4 (now, unstable) -> 4:4.9.2-2 (stable)]
8) gcc [4:5.2.1-4 (now, unstable) -> 4:4.9.2-2 (stable)]
9) gfortran [4:5.2.1-4 (now, unstable) -> 4:4.9.2-2 (stable)]
10) libstdc++6 [5.2.1-16 (now, unstable) -> 4.9.2-10 (stable)]
我接受它y
,当它再次提示确认将安装的软件包列表时,我再次确认。由于这是交互完成的,对于 docker 容器来说没有用,所以我的问题是,如何以编程方式执行此序列?有没有办法编写 aptitude 脚本或类似的东西?