运行 erdpy-up 时出现未满足的依赖项venv 和 ensurepip错误

如何解决运行 erdpy-up 时出现未满足的依赖项venv 和 ensurepip错误

尝试安装 erdpy 失败并显示以下错误

$ python3 erdpy-up.py 
INFO:installer:Checking user.
INFO:installer:Checking Python version.
INFO:installer:Python version: sys.version_info(major=3,minor=6,micro=9,releaselevel='final',serial=0)
INFO:installer:Checking operating system.
INFO:installer:Operating system: linux
INFO:installer:Package [venv] or [ensurepip] not found,will be installed.
INFO:installer:Running [$ sudo apt-get install python3-venv]:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libc6-dbg : Depends: libc6 (= 2.27-3ubuntu1.4) but 2.27-3ubuntu1.3 is to be installed
 libc6-dev : Depends: libc6 (= 2.27-3ubuntu1.4) but 2.27-3ubuntu1.3 is to be installed
 libnss-systemd : Depends: systemd (= 237-3ubuntu10.44)
 python3-venv : Depends: python3.6-venv (>= 3.6.7-1~) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
CRITICAL:installer:Packages [venv] or [ensurepip] not installed correctly.

但是,按原样运行推荐的 apt --fix-broken install 失败并出现以下错误

$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libc6 libc6:i386 libpam-systemd libsystemd0 libsystemd0:i386 systemd
Suggested packages:
  glibc-doc glibc-doc:i386 locales:i386 systemd-container
The following packages will be upgraded:
  libc6 libc6:i386 libpam-systemd libsystemd0 libsystemd0:i386 systemd
6 upgraded,0 newly installed,0 to remove and 161 not upgraded.
6 not fully installed or removed.
Need to get 0 B/8,838 kB of archives.
After this operation,3,072 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
(Reading database ... 326363 files and directories currently installed.)
Preparing to unpack .../libc6_2.27-3ubuntu1.4_amd64.deb ...
De-configuring libc6:i386 (2.27-3ubuntu1.3) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing archive /var/cache/apt/archives/libc6_2.27-3ubuntu1.4_amd64.deb (--unpack):
 new libc6:amd64 package pre-installation script subprocess returned error exit status 1
Preparing to unpack .../libc6_2.27-3ubuntu1.4_i386.deb ...
De-configuring libc6:amd64 (2.27-3ubuntu1.3) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing archive /var/cache/apt/archives/libc6_2.27-3ubuntu1.4_i386.deb (--unpack):
 new libc6:i386 package pre-installation script subprocess returned error exit status 1
Preparing to unpack .../libpam-systemd_237-3ubuntu10.44_amd64.deb ...
Unpacking libpam-systemd:amd64 (237-3ubuntu10.44) over (237-3ubuntu10.41) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libc6_2.27-3ubuntu1.4_amd64.deb
 /var/cache/apt/archives/libc6_2.27-3ubuntu1.4_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

详情

  • 操作系统:Ubuntu 18.04

  • Python:3.6.9

解决方法

问题的根本原因在 fix-broken 命令的输出中清楚地突出显示:

debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process

这是一个 Linux 级别的问题,其中对该文件的锁定已被另一个进程占用,并且其步骤已被记录here

sudo fuser -v /var/cache/debconf/config.dat

会告诉你哪个进程持有锁:

                     USER        PID ACCESS COMMAND
/var/cache/debconf/config.dat:
                     root      18210 F.... dpkg-preconfigu

然后你只需要记下PID并像这样杀死它:

$ sudo kill PID
$ sudo kill -9 PID  # if the first doesn't work

运行 askubuntu 问题中描述的这些步骤后,您可以运行:

$ sudo apt-get install -f

然后你可以运行:

sudo apt --fix-broken install

重试安装erdpy会成功:

$ python3 erdpy-up.py 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?