Use apt with "--force-yes"

Hi all

I am trying to build a Debian Jessie container.
I use https://raw.githubusercontent.com/lxc/lxc-ci/ef3a9803d760d81532caf832248f2f39093b21c8/images/debian.yaml

But I slightly modified it, espacially on the repositories parts, because of repositories moved to archives

When I build a Debian Jessie image, I get

WARNING: The following packages cannot be authenticated!
  libssl1.0.0 libbsd0 libedit2 ...
  libisc-export95 libdns-export100 ...
E: There are problems and -y was used without --force-yes
Error: Failed to manage packages: exit status 100

In the YAML definition file, I already put:


- path: /etc/apt/apt.conf.d/99mihamina
  generator: dump
  content: |-
    APT::Get::AllowUnauthenticated "true";
    APT::Get::Assume-Yes "true";
    APT::Get::force-yes "true";
  types:
  - container
  releases:
  - jessie

In order to try to configure apt to force packages installation.

What can I do more?

Any ideas @monstermunchkin ?

Try doing this:

actions:
- trigger: post-unpack
  action: |-
    cat <<- EOF > /etc/apt/apt.conf.d/99mihamina
    APT::Get::AllowUnauthenticated "true";
    APT::Get::Assume-Yes "true";
    APT::Get::force-yes "true";
    EOF
  types:
  - container
  releases:
  - jessie

Actions with post-unpack are processed right after the tarball is unpacked. The files section on the other hand is processed after packages.

Just needed to prepend the usual “shebang” and it is OK. Thank you again