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


目录
相关文章
使用pip时报错:No module named ‘chardet‘ 的解决办法
使用pip时报错:No module named ‘chardet‘ 的解决办法
1360 0
使用pip时报错:No module named ‘chardet‘ 的解决办法
|
4天前
|
Ubuntu Python
【Python】报错ModuleNotFoundError: No module named ‘XXX‘
【Python】报错ModuleNotFoundError: No module named ‘XXX‘
|
Ubuntu Python
pip3 执行错误 No module named 'distutils.cmd'
pip3 执行错误 No module named 'distutils.cmd'
1512 0
|
6月前
|
Python
spyder下报错ModuleNotFoundError: No module named
spyder下报错ModuleNotFoundError: No module named
255 0
|
6月前
ModuleNotFoundError: No module named ‘conda‘
ModuleNotFoundError: No module named ‘conda‘
|
9月前
pip安装skbuild报错:ModuleNotFoundError: No module named ‘skbuild’解决方法
pip安装skbuild报错:ModuleNotFoundError: No module named ‘skbuild’解决方法,换源
534 0
|
11月前
|
Python
1. 成功解决 Bug:ModuleNotFoundError: No module named 'pip'
Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _ru
166 0
ModuleNotFoundError: No module named ‘pydensecrf‘解决办法
ModuleNotFoundError: No module named ‘pydensecrf‘解决办法
230 0
Python3.6报错:ModuleNotFoundError: No module named 'MySQLdb'
Python3.6报错:ModuleNotFoundError: No module named 'MySQLdb'
137 0
|
Python
ModuleNotFoundError: No module named ‘paramiko‘ 和ModuleNotFoundError: No module named ‘scp‘解决办法
ModuleNotFoundError: No module named ‘paramiko‘ 和ModuleNotFoundError: No module named ‘scp‘解决办法
571 0
ModuleNotFoundError: No module named ‘paramiko‘ 和ModuleNotFoundError: No module named ‘scp‘解决办法