LXC container: mktemp: failed to create file via template

1

On a fresh new container, I do:

lxc-attach -n mycontainer -- apt-get install -y wget

But the installation of wget fails partially with the following message

...
Processing triggers for ca-certificates (20160104) ...
mktemp: failed to create file via template ‘/some/path/on/host/machine’: No such file or directory
dpkg: error processing package ca-certificates (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 ca-certificates

Benoit Blanchon

Posted 2016-03-01T10:01:54.330

Reputation: 196

Answers

1

The solution was simply to clear environment variables, like this:

lxc-attach --clear-env -n mycontainer -- apt-get install -y wget

From lxc-attach --help:

  --clear-env   Clear all environment variables before attaching.
                The attached shell/program will start with only
                container=lxc set.
  --keep-env    Keep all current environment variables. This
                is the current default behaviour, but is likely to
                change in the future.

Benoit Blanchon

Posted 2016-03-01T10:01:54.330

Reputation: 196