我两天前从 Ubuntu 20.04 升级到了 Ubuntu 22.04。之后,当我从 GUI 或 cli(使用 update-manager 命令)打开“软件和更新”时,它运行良好,最后显示:The software on this computer is up to date
。然后我可以选择“设置和 Livepatch...”。当我单击它时,什么都没有出现,但在终端中我收到以下错误消息。
Traceback (most recent call last):
File "/usr/bin/software-properties-gtk", line 100, in <module> app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 254, in __init__self.init_ubuntu_pro()
File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 1661, in init_ubuntu_pro self.ubuntu_pro_page = UbuntuProPage(self)
File "/usr/lib/python3/dist-packages/softwareproperties/gtk/UbuntuProPage.py", line 83, in __init__ubuntu_pro_logo = GdkPixbuf.Pixbuf.new_from_file_at_scale(os.path.join(parent.datadir, 'ubuntu-pro-logo.svg'), -1, 50, True)
gi.repository.GLib.GError:
gdk-pixbuf-error-quark: Couldn't recognize the image file format
for file "/usr/share/software-properties/ubuntu-pro-logo.svg" (3)
该文件存在并且文件类型似乎正确。
$ ls -l /usr/share/software-properties/ubuntu-pro-logo.svg
-rw-r--r-- 1 root root 4989 gen 20 11:58 /usr/share/software-properties/ubuntu-pro-logo.svg
$ file /usr/share/software-properties/ubuntu-pro-logo.svg
/usr/share/software-properties/ubuntu-pro-logo.svg: SVG Scalable Vector Graphics image
对于要检查什么,您有什么建议吗?
答案1
发生这种情况时,您通常可以通过使用这两个命令重新生成 mime 缓存来解决它:
sudo update-mime-database /usr/share/mime
和
sudo /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache