从 Ubuntu 16.04 lts 升级到 18.04 lts 时出错

从 Ubuntu 16.04 lts 升级到 18.04 lts 时出错

当我按照发行说明并使用软件更新程序update-manager -c,它会崩溃,并且 shell 中的替代 gtk 也显示 Python 错误。我住在加拿大,如果这意味着什么的话。如何解决这个问题?

sudo /usr/lib/ubuntu-release-upgrader/check-new-release-gtk 
[sudo] password for techsri: 
/usr/lib/ubuntu-release-upgrader/check-new-release-gtk:30: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
Checking for a new Ubuntu release
/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeFetcher.py:23: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, Gdk
/usr/lib/python3/dist-packages/DistUpgrade/ReleaseNotesViewerWebkit.py:33: PyGIWarning: WebKit2 was imported without specifying a version first. Use gi.require_version('WebKit2', '4.0') before import to ensure that the right version gets loaded.
  from gi.repository import WebKit2 as WebKit
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
authenticate 'bionic.tar.gz' against 'bionic.tar.gz.gpg' 
extracting 'bionic.tar.gz'
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-d7e7sf9p/bionic", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-d7e7sf9p/DistUpgrade/DistUpgradeMain.py", line 224, in main
    from .DistUpgradeController import DistUpgradeController
  File "/tmp/ubuntu-release-upgrader-d7e7sf9p/DistUpgrade/DistUpgradeController.py", line 52, in <module>
    from .DistUpgradeQuirks import DistUpgradeQuirks
  File "/tmp/ubuntu-release-upgrader-d7e7sf9p/DistUpgrade/DistUpgradeQuirks.py", line 36, in <module>
    from janitor.plugincore.manager import PluginManager
  File "/tmp/ubuntu-release-upgrader-d7e7sf9p/janitor/__init__.py", line 20, in <module>
    import pkg_resources
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources.py", line 621
    except ResolutionError,v:
                          ^
SyntaxError: invalid syntax
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.5/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-d7e7sf9p/bionic", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-d7e7sf9p/DistUpgrade/DistUpgradeMain.py", line 224, in main
    from .DistUpgradeController import DistUpgradeController
  File "/tmp/ubuntu-release-upgrader-d7e7sf9p/DistUpgrade/DistUpgradeController.py", line 52, in <module>
    from .DistUpgradeQuirks import DistUpgradeQuirks
  File "/tmp/ubuntu-release-upgrader-d7e7sf9p/DistUpgrade/DistUpgradeQuirks.py", line 36, in <module>
    from janitor.plugincore.manager import PluginManager
  File "/tmp/ubuntu-release-upgrader-d7e7sf9p/janitor/__init__.py", line 20, in <module>
    import pkg_resources

      File "/usr/local/lib/python3.5/dist-packages/pkg_resources.py", line 621
        except ResolutionError,v:
                              ^
    SyntaxError: invalid syntax

这是错误日志:

Tried those steps, no effect. Here's the upgrade error log.`2018-09-04 16:37:32,358 INFO Using config files '['./DistUpgrade.cfg.xenial']'
2018-09-04 16:37:32,358 INFO uname information: 'Linux techsri-Asus-GL552VW 4.4.3-040403-generic #201602251634 SMP Thu Feb 25 21:36:25 UTC 2016 x86_64'
2018-09-04 16:37:32,709 INFO apt version: '1.2.27'
2018-09-04 16:37:32,710 INFO python version: '3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609]'
2018-09-04 16:37:32,712 INFO release-upgrader version '18.04.24' started
2018-09-04 16:37:32,777 INFO locale: 'en_US' 'UTF-8'
2018-09-04 16:37:32,915 ERROR not handled exception:
Traceback (most recent call last):

  File "/tmp/ubuntu-release-upgrader-llt8xeg8/bionic", line 8, in <module>
    sys.exit(main())

  File "/tmp/ubuntu-release-upgrader-llt8xeg8/DistUpgrade/DistUpgradeMain.py", line 224, in main
    from .DistUpgradeController import DistUpgradeController

  File "/tmp/ubuntu-release-upgrader-llt8xeg8/DistUpgrade/DistUpgradeController.py", line 52, in <module>
    from .DistUpgradeQuirks import DistUpgradeQuirks

  File "/tmp/ubuntu-release-upgrader-llt8xeg8/DistUpgrade/DistUpgradeQuirks.py", line 36, in <module>
    from janitor.plugincore.manager import PluginManager

  File "/tmp/ubuntu-release-upgrader-llt8xeg8/janitor/__init__.py", line 20, in <module>
    import pkg_resources

  File "/usr/local/lib/python3.5/dist-packages/pkg_resources.py", line 621

    except ResolutionError,v:

                          ^

SyntaxError: invalid syntax

2018-09-04 16:37:32,915 DEBUG running apport_crash()
~                                                                                                                                                                                                                   
~                                                                                                                                                                                                                   
~                                                                                                                                                                                                                   
~  

                                                        `

答案1

除了可以访问互联网之外,您的位置不会有任何区别,升级服务器也会共享负载*。

没有看到错误,我只是在猜测,但首先我会检查几件事(我将为每个事包含命令行命令):

  1. 确保你可以访问互联网
  2. 确保有足够的磁盘空间(df -h)。安装程序会检查这一点,但如果出现问题,最好再次检查。
  3. 进行适当的自动修复(apt -f install
  4. 阅读升级错误日志(也许将其复制到您的问题中)。它位于文件夹中/var/log/dist-upgrade/

如果这不起作用,请使用错误更新您的问题。:)

*(除非您已将升级路径明确锁定到特定服务器,但这并不容易,而且如果您这样做了,您可能就会知道)

相关内容