更新时出现错误消息

更新时出现错误消息

我收到以下错误消息。它没有解释我正在导入什么,所以我不知道如何纠正它。我甚至不知道我正在导入,我以为我正在更新。

# update-manager -d
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: 05:19:30.703: GtkDialog mapped without a transient parent. This is discouraged.

答案1

这个错误最近已通知 Ubuntu。以下是修复这几个错误的方法。如果您仔细查看此错误,它已经为您提供了有关错误所在以及如何修复的信息。

步骤 1:打开终端并输入

cd /usr/lib/python3/dist-packages/DistUpgrade

这里你需要处理两个 python 文件DistUpgradeFetcher.pyReleaseNotesViewerWebkit.py

好的,让我们先修复 DistUpgradeFetcher.py :) 使用任何文本编辑器打开此文件并将导入行修复为:

import gi
gi.require_version("Gtk","3.0")
from gi.repository import Gtk

类似地,打开 ReleaseNotesViewerWebkit.py 并将导入行修复为:

import gi
gi.require_version('WebKit2', '4.0')
from .ReleaseNotesViewer import open_url
from gi.repository import Gtk

这样做将修复错误,并且在运行时sudo update-manager -d不会出现错误。

相关内容