执行apt-get update时 报错ModuleNotFoundError: No module named ‘debian‘

简介: 执行apt-get update时 报错ModuleNotFoundError: No module named ‘debian‘

最近在安装环境时执行apt-get update或者upgrade时,总是报错:


Setting up update-notifier-common (3.192.1.11) ...

Traceback (most recent call last):

 File "/usr/lib/update-notifier/package-data-downloader", line 24, in <module>

   import debian.deb822

ModuleNotFoundError: No module named 'debian'

dpkg: error processing package update-notifier-common (--configure):

installed update-notifier-common package post-installation script subprocess returned error exit status 1

No apport report written because the error message indicates its a followup error from a previous failure.

dpkg: dependency problems prevent configuration of update-notifier:

update-notifier depends on update-notifier-common (= 3.192.1.11); however:

 Package update-notifier-common is not configured yet.

dpkg: error processing package update-notifier (--configure):

dependency problems - leaving unconfigured

dpkg: dependency problems prevent configuration of ubuntu-desktop:

ubuntu-desktop depends on update-notifier; however:

 Package update-notifier is not configured yet.

dpkg: error processing package ubuntu-desktop (--configure):

dependency problems - leaving unconfigured

No apport report written because the error message indicates its a followup error from a previous failure.

Errors were encountered while processing:

update-notifier-common

update-notifier

ubuntu-desktop


安装进行不下去,之前好好的,怎么会出现这种奇怪的事呢,按理说apt-get update是Ubuntu最核心和常用的工具了,不大可能会没有正确安装的,仔细想想安装环境过程中都做了些什么,这个 import debian.deb822报错应该是python相关的东西,那最有可能是python安装不对或者版本不对了,于是突然想起为了满足实验某模型的要求安装了个很新的python3.9.6,并且把/usr/bin/python3指向了python3.9.6,可能就是这个python版本太高了的原因引起的,于是删掉/usr/bin/python3,重新创建链接指向python3.6.8,再执行apt-get update就正常了!


Setting up update-notifier-common (3.192.1.11) ...

Setting up update-notifier (3.192.1.11) ...

Setting up ubuntu-desktop (1.417.5) ...

  • 没有reinstall,sudo apt remove python3-debian && sudo apt install python3-debian
  • 亲测: 其实可以执行`sudo apt reinstall python3-debian` 以修复.


目录
相关文章
|
编解码 Ubuntu 虚拟化
【问题解决】VMware安装ubuntu操作系统出现分辨率的问题
【问题解决】VMware安装ubuntu操作系统出现分辨率的问题
3417 0
【问题解决】VMware安装ubuntu操作系统出现分辨率的问题
|
5月前
|
缓存 安全 Linux
Linux 内核 Copy Fail 漏洞对加密货币基础设施安全影响研究
2026年曝出的Linux内核漏洞Copy Fail(CVE-2026-31431),源于2017年代码缺陷,可让低权限用户稳定提权至root,具备无磁盘痕迹、跨容器逃逸、利用极简等特点,已遭野外利用。该漏洞对加密货币行业构成系统性威胁,覆盖交易所、节点、钱包、矿池等核心设施。本文基于权威报道,剖析其技术机理与风险传导,提出含内核加固、权限隔离、eBPF检测、应急响应的全生命周期防御体系,并提供可复现代码与工程化方案。(239字)
273 7
|
5月前
|
域名解析 网络协议 Ubuntu
改了DNS还是不生效?Ubuntu 24.04的这个坑我帮你踩过了
Ubuntu 24.04因`systemd-resolved`接管DNS,手动改`/etc/resolv.conf`无效,导致Docker拉镜像失败、`ping: Temporary failure in name resolution`。本文详解通过修改`/etc/systemd/resolved.conf`、重建软链接并重启服务,彻底修复DNS解析问题。(239字)
889 7
改了DNS还是不生效?Ubuntu 24.04的这个坑我帮你踩过了
|
异构计算 Python
ERROR: pip’s dependency resolver does not currently take into 报错-Python项目依赖冲突的解决方案-优雅草优雅草卓伊凡
ERROR: pip’s dependency resolver does not currently take into 报错-Python项目依赖冲突的解决方案-优雅草优雅草卓伊凡
898 1
|
Ubuntu Linux Windows
Debian:apt-get命令汇总
`apt-get` 是 Debian 及其衍生发行版(如 Ubuntu)中的核心包管理工具,用于安装、更新和卸载软件。它通过操作 `.deb` 格式的软件包,实现对系统软件的集中管理。常见命令包括 `install`(安装)、`remove`(卸载)、`update`(更新软件列表)和 `upgrade`(升级软件)。此外,`autoclean` 和 `clean` 可清理无用的包文件以释放空间。掌握 `apt-get` 的使用方法,是 Linux 系统管理的基础技能之一。
940 3
|
Linux
【Function App】记录一次 "OSError: Could not find a suitable TLS CA certificate bundle" 错误
错误信息:We get an error in function app. Exception: OSError: Could not find a suitable TLS CA certificate bundle, invalid path: /home/site/wwwroot/.python_packages/lib/site-packages/certifi/cacert.pem This issue happened by chance. This appears to be a platform issue with Function Apps running on Linux
415 6
|
开发工具 git
使用git提交到远程仓库报错:Updates were rejected because the remote contains work that you do
使用git提交到远程仓库报错:Updates were rejected because the remote contains work that you do
5084 0
使用git提交到远程仓库报错:Updates were rejected because the remote contains work that you do
|
Java Android开发 Windows
使用keytool查看Android APK签名
本文介绍了如何使用Windows命令行工具和keytool查看APK的签名信息,并提供了使用AOSP环境中的signapk.jar工具对APK进行系统签名的方法。
3036 0
使用keytool查看Android APK签名
|
Linux 网络安全 Python
Linux离线安装Python时ssh和hashlib死活安装不上的解决方案
本文提供了Linux环境下离线安装Python时遇到的"ImportError: No module named _ssl"和"ERROR:root:code for hash md5|sha1|sha224|sha256|sha384|sha512 was not found"两个问题的解决方案,通过设置OpenSSL环境变量和编辑Python源码配置文件来解决。
979 1
|
Ubuntu Linux 芯片
Linux 驱动开发基础知识——设备树的语法驱动开发基础知识(九)
Linux 驱动开发基础知识——设备树的语法驱动开发基础知识(九)
1374 1
Linux 驱动开发基础知识——设备树的语法驱动开发基础知识(九)