如何解决更新时出现“没有名为‘distro_info’的模块”的问题

如何解决更新时出现“没有名为‘distro_info’的模块”的问题

我正在尝试更新我的 ubuntu 18.04,但是当我尝试运行时sudo do-release-upgrade出现以下错误:

Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1.554 B]                                         
Get:2 Upgrade tool [1.210 kB]                                                  
Fetched 1.212 kB in 0s (0 B/s)                                                 
authenticate 'disco.tar.gz' against 'disco.tar.gz.gpg' 
extracting 'disco.tar.gz'

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/disco", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/DistUpgrade/DistUpgradeMain.py", line 224, in main
    from .DistUpgradeController import DistUpgradeController
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/DistUpgrade/DistUpgradeController.py", line 25, in <module>
    import distro_info
ModuleNotFoundError: No module named 'distro_info'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/problem_report.py", line 497, in add_to_existing
    self.write(f)
  File "/usr/lib/python3/dist-packages/problem_report.py", line 450, in write
    block = f.read(1048576)
  File "/usr/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

Original exception was:
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/disco", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/DistUpgrade/DistUpgradeMain.py", line 224, in main
    from .DistUpgradeController import DistUpgradeController
  File "/tmp/ubuntu-release-upgrader-qvik6xoe/DistUpgrade/DistUpgradeController.py", line 25, in <module>
    import distro_info
ModuleNotFoundError: No module named 'distro_info'

我尝试安装 python3-distro-info(已安装且为最新版本)和 python-distro-info,安装后没有任何变化。
我该怎么做才能成功升级?

答案1

sudo apt-get install --reinstall python3-distro-info对我有用。

相关内容