【问题标题】:Issue installing python3-dev on fresh install of Ubuntu 18.04 in Vagrant box在 Vagrant 框中全新安装 Ubuntu 18.04 时安装 python3-dev 的问题
【发布时间】:2019-06-16 21:59:31
【问题描述】:

我的Vagrantfile如下:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Set Vagrant Minimum Version
Vagrant.configure("2") do |config|

  config.vm.box = "bento/ubuntu-18.04"

  config.vm.network :forwarded_port, guest: 80, host: 8000
  config.vm.network :private_network, type: "dhcp"
  config.vm.synced_folder ".", "/vagrant"

  # Determine the available cores in host system.
  cpu_count = 1
  if RUBY_PLATFORM =~ /linux/
    cpu_count = `nproc`.to_i
  elsif RUBY_PLATFORM =~ /darwin/
    cpu_count = `sysctl -n hw.ncpu`.to_i
  end

  config.vm.provider "vmware_fusion" do |v|
    v.vmx['memsize'] = 4096
    v.vmx['numvcpus'] = (cpu_count / 2).ceil
  end
end

我使用的是便当/ubuntu-18.04 框,我可以成功执行vagrant up,但如果我运行以下命令:

sudo apt-get update 
sudo apt-get install python3-dev

我收到一条相当长的错误消息,如下所示:

Checking init scripts...
dpkg: error processing package libssl1.1:amd64 (--configure):
 installed libssl1.1:amd64 package post-installation script subprocess returned error exit status 10
Setting up libexpat1-dev:amd64 (2.2.5-3) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up python3-lib2to3 (3.6.8-1~18.04) ...
Setting up python3-distutils (3.6.8-1~18.04) ...
dpkg: dependency problems prevent configuration of libssl-dev:amd64:
 libssl-dev:amd64 depends on libssl1.1 (= 1.1.1-1ubuntu2.1~18.04.2); however:
  Package libssl1.1:amd64 is not configured yet.

dpkg: error processing package libssl-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpython3.6-minimal:amd64:
 libpython3.6-minimal:amd64 depends on libssl1.1 (>= 1.1.1); however:
  Package libssl1.1:amd64 is not configured yet.

dpkg: error processing package libpython3.6-minimal:amd64 (--configure):
 dependency problems - leaving unconfigured
Setting up dh-python (3.20180325ubuntu2) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because the error message indicates its a followup error from a previous failure.
        dpkg: dependency problems prevent configuration of libpython3.6-stdlib:amd64:
 libpython3.6-stdlib:amd64 depends on libpython3.6-minimal (= 3.6.8-1~18.04.1); however:
  Package libpython3.6-minimal:amd64 is not configured yet.

dpkg: error processing package libpython3.6-stdlib:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3.6:
 python3.6 depends on libpython3.6-stdlib (= 3.6.8-1~18.04.1); however:
  Package libpython3.6-stdlib:amd64 is not configured yet.

dpkg: error processing package python3.6 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3.6-minimal:
 python3.6-minimal depends on libpython3.6-minimal (= 3.6.8-1~18.04.1); however:
  Package libpython3.6-minimal:amd64 is not configured yet.

dpkg: error processing package python3.6-minimal (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration No apport report written because MaxReports is reached already
                                                                                                              No apport report written because MaxReports is reached already
                                                                                                                                                                            No apport report written because MaxReports is reached already
                              No apport report written because MaxReports is reached already
                                                                                            No apport report written because MaxReports is reached already
                                                                                                                                                          No apport report written because MaxReports is reached already
            No apport report written because MaxReports is reached already
                                                                          No apport report written because MaxReports is reached already
                                                                                                                                        of libpython3.6-dev:amd64:
 libpython3.6-dev:amd64 depends on libpython3.6-stdlib (= 3.6.8-1~18.04.1); however:
  Package libpython3.6-stdlib:amd64 is not configured yet.

dpkg: error processing package libpython3.6-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3.6-dev:
 python3.6-dev depends on python3.6 (= 3.6.8-1~18.04.1); however:
  Package python3.6 is not configured yet.
 python3.6-dev depends on libpython3.6-dev (= 3.6.8-1~18.04.1); however:
  Package libpython3.6-dev:amd64 is not configured yet.

dpkg: error processing package python3.6-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpython3.6:amd64:
 libpython3.6:amd64 depends on libpython3.6-stdlib (= 3.6.8-1~18.04.1); however:
  Package libpython3.6-stdlib:amd64 is not configured yet.

dpkg: error processing package libpython3.6:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpython3-dev:amd64:
 libpython3-dev:amd64 depends on libpython3.6-dev (>= 3.6.7-1~); however:
  Package libpython3.6-dev:amd64 is not configured yet.

dpkg: error processing package libpython3-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-dev:
 python3-dev depends on libpython3-dev (= 3.6.7-1~18.04); however:
  Package libpython3-dev:amd64 is not configured yet.
 python3-dev depends on python3.6-dev (>= 3.6.7-1~); however:
  Package python3.6-dev is not configured yet.

dpkg: error processing package python3-dev (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Errors were encountered while processing:
 libssl1.1:amd64
 libssl-dev:amd64
 libpython3.6-minimal:amd64
 libpython3.6-stdlib:amd64
 python3.6
 python3.6-minimal
 libpython3.6-dev:amd64
 python3.6-dev
 libpython3.6:amd64
 libpython3-dev:amd64
 python3-dev
E: Sub-process /usr/bin/dpkg returned an error code (1)

我已经确认这也发生在其他机器上,也使用相同的 Vagrant 盒子,但使用了 Virtualbox 设置。它也没有成功安装 python-dev 环境。我在尝试安装 Postgres 时也得到了类似的结果,并且出现了几乎相同的错误消息。

流浪版本是: 2.2.3

VMWare 融合版本: 8.1.1

操作系统: macOS Mojave 10.14.4

【问题讨论】:

    标签: python-3.x vagrant ubuntu-18.04


    【解决方案1】:

    我遇到了同样的问题。这一切似乎都源于libssl1.1 包的问题。升级系统似乎可以解决问题:

    sudo apt-get update
    sudo apt-get upgrade
    

    这可能需要一段时间。在某些时候,有人问我是否接受 Ubuntu 附带的新版本配置文件,我回答是 (Y)。

    Configuration file '/etc/update-manager/release-upgrades'
     ==> Modified (by you or by a script) since installation.
     ==> Package distributor has shipped an updated version.
       What would you like to do about it ?  Your options are:
        Y or I  : install the package maintainer's version
        N or O  : keep your currently-installed version
          D     : show the differences between the versions
          Z     : start a shell to examine the situation
     The default action is to keep your current version.
    *** release-upgrades (Y/I/N/O/D/Z) [default=N] ?
    

    在此之后,apt-get install 起作用了。

    【讨论】:

    • 做到了!非常感谢!!我让 vagrant box 维护者知道我也遇到了这个问题,所以希望它在未来得到修复,但现在这样做完全可行!
    猜你喜欢
    • 2019-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-13
    • 1970-01-01
    • 2021-10-17
    • 2019-11-11
    • 2019-02-16
    相关资源
    最近更新 更多