LXC容器:mktemp:无法通过模板创建文件


1

在一个新的容器上,我做:

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

但是,wget的安装部分失败,并显示以下消息

...
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

Answers:


1

解决方案只是清除环境变量,如下所示:

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

来自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.
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.