nanxstats / liftr

🐳 Containerize R Markdown documents for continuous reproducibility
https://nanx.me/liftr/
GNU General Public License v3.0
170 stars 20 forks source link

using liftr with base image rocker/hadleyverse fails #16

Closed behrica closed 7 years ago

behrica commented 7 years ago

During the docker build I get this error message:

Step 3 : RUN rm -f /var/lib/dpkg/available   && rm -rf  /var/cache/apt/*   && apt-get update -qq   && apt-get install -t unstable -y --no-install-recommends     ca-certificates     libssl-dev     libcurl4-openssl-dev     libxml2-dev     libssh2-1-dev     git
 ---> Running in 33d1f5bdb8d8
Reading package lists...
Building dependency tree...
Reading state information...
ca-certificates is already the newest version (20160104).
git is already the newest version (1:2.9.3-1).
libxml2-dev is already the newest version (2.9.4+dfsg1-2).
libssl-dev is already the newest version (1.0.2j-1).
The following packages were automatically installed and are no longer required:
  libgmp-dev libgmpxx4ldbl libmhash2 libraptor2-0 librasqal3 librdf0
  libyajl-dev libyajl2
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libgcrypt20 libgcrypt20-dev libgpg-error-dev
Suggested packages:
  libcurl4-doc libcurl3-dbg libidn11-dev libkrb5-dev libldap2-dev librtmp-dev
  rng-tools libgcrypt20-doc
The following packages will be REMOVED:
  libcurl4-gnutls-dev libraptor2-dev librasqal3-dev librdf0-dev
The following NEW packages will be installed:
  libcurl4-openssl-dev libgcrypt20-dev libgpg-error-dev libssh2-1-dev
The following packages will be upgraded:
  libgcrypt20
1 upgraded, 4 newly installed, 4 to remove and 132 not upgraded.
Need to get 1,778 kB of archives.
After this operation, 1,180 kB disk space will be freed.
Get:1 http://debian.mirror.lrz.de/debian testing/main amd64 libcurl4-openssl-dev amd64 7.50.1-1 [362 kB]
Get:2 http://debian.mirror.lrz.de/debian testing/main amd64 libgcrypt20 amd64 1.7.3-2 [489 kB]
Get:3 http://debian.noc.ntua.gr/debian testing/main amd64 libgpg-error-dev amd64 1.24-1 [81.7 kB]
Get:4 http://debian.mirror.lrz.de/debian testing/main amd64 libgcrypt20-dev amd64 1.7.3-2 [539 kB]
Get:5 http://debian.noc.ntua.gr/debian testing/main amd64 libssh2-1-dev amd64 1.7.0-1 [306 kB]
debconf: delaying package configuration, since apt-utils is not installed
dpkg: error: failed to open package info file '/var/lib/dpkg/available' for reading: No such file or directory
Fetched 1,778 kB in 2s (763 kB/s)
E: Sub-process dpkg --set-selections returned an error code (2)
E: Couldn't record the approved state changes as dpkg selection states

It does not like the removal of the 'available' file. Without this it works.

behrica commented 7 years ago

There is something strange with this 'available' file. On my PC, Ubuntu 14.10, removing it, makes indeed a problem and shows the same error.

On the other side, I read that 'apt-get update' should recreated, but it does not. (for me, at least)

And it works for image r-base:latest , but not for rocker/hadleyverse (which inherits from r-base ....)

behrica commented 7 years ago

Some background here:

http://unix.stackexchange.com/questions/161866/how-to-recreate-var-lib-dpkg-status

nanxstats commented 7 years ago

This issue has been confirmed. Waiting to be fixed.

nanxstats commented 7 years ago

@behrica - thanks a lot for reporting this issue. It has been fixed by https://github.com/road2stat/liftr/commit/d62574e0439bd134f3d8bd148e120e560dfc6ab3.

Note that you will need to set pandoc to false when using rocker/hadleyverse or rocker/tidyverse since they already had that. For example:

liftr:
  from: "rocker/hadleyverse:latest"
  pandoc: false