执行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) ...

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Arnold-FY-Chen

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值