在 Ubuntu 18.04 上以不连贯的状态打包“python3-apt" [英] package 'python3-apt' in incoherent state on Ubuntu 18.04

查看:54
本文介绍了在 Ubuntu 18.04 上以不连贯的状态打包“python3-apt"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我的 Ubuntu 桌面上出现了一个与更新相关的禁止进入标志.

Few days ago, I got a no-entry sign on my Ubuntu desktop related to updates.

我检查了我的 Java8 ppa 可能需要做些什么,尽管这不是阻止 gnome-console 启动的原因.此外,我最近安装了一些似乎与该问题无关的软件包.

I checked there is probably something to be done about my Java8 ppa though that is not what is preventing gnome-console to start. Also I recently installed some packages that seemed unrelated to the issue.

所以我开始了一个 Ubuntu 论坛线程

显然 python3-apt 是问题的艺术,但我没有重新安装.我正在考虑使用 wget 获取它并在允许的情况下进行手动安装(在我的最新答案中提到).

Apparently python3-apt is at the art of the problem but I didn't manage a reinstall. I'm considering getting it using wget and do a manual install if allowed (mentionned in my latest answers).

Les paquets suivants sont dans un état incohérent à Cause de sérieux安装问题 survenus lors de l'installation.Ils doivent être réinstallés(ainsi que tous les paquets qui en dependent) 倒 pouvoir fonctionner更正:python3-apt 到 libapt-pkg 的 Python 3 接口

Les paquets suivants sont dans un état incohérent à cause de sérieux problèmes survenus lors de l'installation. Ils doivent être réinstallés (ainsi que tous les paquets qui en dépendent) pour pouvoir fonctionner correctement : python3-apt Python 3 interface to libapt-pkg

上述错误要求我重新安装以下(以及所有依赖的软件包):

The above error asked me to reinstall the following (as well as all depending packages) :

python3-apt Python 3 libapt-pkg 接口

python3-apt Python 3 interface to libapt-pkg

问题出在更新 cmd 上:

Problem was with update cmd:

sudo apt 更新

sudo apt update

输出:

E: 执行脚本时出现问题 APT::Update::Post-Invoke-Success 'if/usr/bin/test -w/var/lib/command-not-found/-a -e/usr/lib/cnf-更新数据库;然后/usr/lib/cnf-update-db >/dev/null;菲'E:子进程返回错误码

E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi' E: Sub-process returned an error code

现在,尝试通过 sudo apt install --reinstall -y python3-apt 重新安装 python3-apt返回:

And now, trying reinstalling python3-apt via sudo apt install --reinstall -y python3-apt returns :

dpkg:清理时出错:已安装的 python3-apt 包安装后脚本子进程返回错误退出状态 127Des erreurs ont été rencontrées pendant l'execution :/var/cache/apt/archives/python3-apt_1.6.5ubuntu0.2_amd64.debE:子进程/usr/bin/dpkg返回错误码(1)

dpkg : error while cleaning up: installed python3-apt package post-installation script subprocess returned error exit status 127 Des erreurs ont été rencontrées pendant l'exécution : /var/cache/apt/archives/python3-apt_1.6.5ubuntu0.2_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

请原谅我的法语解释,但结尾是用英语写的.

Excuse me for the French explanations but the end is written in English.

我正在寻找如何正确重新安装,也许我指出了解决方案,但还没有找出正确的命令,也许还探索了 libapt-pkg 状态.同样如上所述,这是在终端崩溃之前无法重新启动之前更新时间的问题.

I'm looking for how to reinstall properly, maybe I pointed the solution but have yet to figure out proper commands and maybe exploring libapt-pkg state as well. Also as above mentionned, it was a problem at update time before terminal crashed not to restart anymore.

感谢您的贡献.

推荐答案

我将在提到的 ubuntu-forum 帖子中详细发布通用解决方案.

I'm posting general solution as available in details within the ubuntu-forum post mentioned.

一旦我在临时文件夹中重新安装了 python3-minimal 下载,就可以修复 python3-apt,因此我从 ubuntu 存储库进行了全新安装:

Fix to python3-apt was possible once I reinstalled python3-minimal downloading in a temp folder so I got a fresh install from ubuntu repositories:

确保根据您的系统要求获得所需的包,并使用 YOUR_ACTUAL_PACKAGE_VERSION 寻找您自己的必要 deb:

Make sure you get the desired package according to your system requirements with YOUR_ACTUAL_PACKAGE_VERSION looking for your own necessary deb:

sudo apt clean && wget -c http://security.ubuntu.com/ubuntu/pool/main/p/python-apt/python3-apt_YOUR_ACTUAL_PACKAGE_VERSION.deb

sudo dpkg -i --force-all python3-apt_apt_YOUR_ACTUAL_PACKAGE_VERSION.deb

sudo apt install -fy
sudo apt update && sudo apt full-upgrade

(这些步骤可以从第 3 页找到)sudo apt install -fy

(these steps can be found from page 3) sudo apt install -fy

sudo apt 更新 &&sudo apt 全面升级

sudo apt update && sudo apt full-upgrade

这篇关于在 Ubuntu 18.04 上以不连贯的状态打包“python3-apt"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆