执行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` 以修复.


目录
相关文章
|
机器学习/深度学习 数据可视化 算法
机器学习系列7 基于Python的Scikit-learn库构建逻辑回归模型
🎄🎄本文中,你将学到逻辑回归的数学原理,使用Seaborn库可视化数据寻找数据间的相关性,并基于Scikit-learn库构建逻辑回归模型预测南瓜颜色。
637 0
|
10月前
|
Ubuntu Linux Docker
Ubuntu22.04上Docker的安装
通过以上详细的安装步骤和命令,您可以在Ubuntu 22.04系统上顺利安装
6218 12
|
Ubuntu Docker 容器
sudo apt-get update失败已经解决 报错 The update command takes no arguments
sudo apt-get update失败已经解决 报错 The update command takes no arguments
935 0
|
11月前
|
JSON 搜索推荐 C++
vscode如何更改背景颜色主题,黑色或白色?
【11月更文挑战第16天】在 VS Code 中更改背景颜色主题,可通过三种方式实现:1) 使用快捷键 Ctrl+K 和 Ctrl+T(Mac 上为 Command+K 和 Command+T)选择主题;2) 通过菜单中的“管理”-&gt;“颜色主题”选项选择;3) 修改 settings.json 文件中的 &quot;workbench.colorTheme&quot; 属性。此外,用户还可从扩展市场安装更多主题以满足个性化需求。
23386 6
|
存储 缓存 Ubuntu
Ubuntu apt-get 命令大全
【7月更文挑战第12天】
764 6
Ubuntu apt-get 命令大全
|
JSON PHP Apache
[GFCTF 2021]Baby_Web(CVE-2021-41773) 从一道题入门PHP代码审计 (保姆级)
[GFCTF 2021]Baby_Web(CVE-2021-41773) 从一道题入门PHP代码审计 (保姆级)
148 1
|
安全 网络安全 Apache
CVE-2021-41773 复现
CVE-2021-41773 复现
631 1
|
开发框架 前端开发 JavaScript
循序渐进VUE+Element 前端应用开发(33)--- 邮件参数配置和模板邮件发送处理
循序渐进VUE+Element 前端应用开发(33)--- 邮件参数配置和模板邮件发送处理
|
机器学习/深度学习 XML 计算机视觉
OpenCV(Open Source Computer Vision Library)是一个开源的计算机视觉和机器学习库,它提供了大量的函数和工具,用于处理图像和视频数据。
OpenCV(Open Source Computer Vision Library)是一个开源的计算机视觉和机器学习库,它提供了大量的函数和工具,用于处理图像和视频数据。