我全新安装了 16.04,并且已经安装了 kvm。我正在尝试使用 vmbuilder 创建虚拟机。
sudo vmbuilder kvm ubuntu --suite xenial --flavour virtual --arch i386 -o --libvirt qemu:///system --ip 10.0.0.80 --hostname sabsickvm --bridge br0
Run Code Online (Sandbox Code Playgroud)
当我在没有显示 vms 后运行 virsh list 时
当一切“完成”时,我看到
Errors were encountered while processing:
sudo
Extracting templates from packages: 100%
W: --force-yes is deprecated, use one of the options starting with --allow instead.
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)
小智 2
为force-confnew 设置 dpkg 选项也似乎可以工作:
patch /usr/lib/python2.7/dist-packages/VMBuilder/plugins/ubuntu/dapper.py<<EOT
@@ -72,7 +72,7 @@
self.call_hook('fix_ownership', manifest)
def update(self):
- self.run_in_target('apt-get', '-y', '--force-yes', 'dist-upgrade',
+ self.run_in_target('apt-get', '-y', '--force-yes', '--option=Dpkg::Options::=--force-confnew', 'dist-upgrade',
env={ 'DEBIAN_FRONTEND' : 'noninteractive' })
def install_authorized_keys(self):
EOT
Run Code Online (Sandbox Code Playgroud)
小智 1
我现在遇到了同样的问题,使用 1 周前(2016 年 9 月 28 日)的相同设置,当时没有错误。我的安装几乎与操作相同,只是我使用的是 amd64。
我提供了我用作创可贴的解决方案,直到修复了潜在的错误。
解决方案:
1. change the word 'dist-upgrade' to 'update' in
/usr/lib/python2.7/dist-packages/VMBuilder/plugins/ubuntu/dapper.py
2. delete /usr/lib/python2.7/dist-packages/VMBuilder/plugins/ubuntu/dapper.pyc
Run Code Online (Sandbox Code Playgroud)
现在重新运行 vmbuilder。我仍然遇到一些错误/警告,但它构建得很好。
认识到这并没有解决根本问题,但它确实让您现在可以使用:vmbuilder with 16.04。
| 归档时间: |
|
| 查看次数: |
2819 次 |
| 最近记录: |