動かざることバグの如し

近づきたいよ 君の理想に

apt updateするとGLib-Errorエラーになる問題

環境

症状

apt updateしようとすると「Sub-process returned an error code」エラーになってしまう

# apt update
ヒット:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
ヒット:3 http://jp.archive.ubuntu.com/ubuntu bionic InRelease
ヒット:4 http://jp.archive.ubuntu.com/ubuntu bionic-updates InRelease
ヒット:5 http://jp.archive.ubuntu.com/ubuntu bionic-backports InRelease

(appstreamcli:13840): GLib-CRITICAL **: 19:06:54.994: g_variant_builder_end: assertion '!GVSB(builder)->uniform_item_types || GVSB(builder)->prev_item_type != NULL || g_variant_type_is_definite (GVSB(builder)->type)' failed

(appstreamcli:13840): GLib-CRITICAL **: 19:06:54.994: g_variant_new_variant: assertion 'value != NULL' failed

(appstreamcli:13840): GLib-ERROR **: 19:06:54.994: g_variant_new_parsed: 11-13:invalid GVariant format string
Trace/breakpoint trap (core dumped)
パッケージリストを読み込んでいます... 完了
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'
E: Sub-process returned an error code

対応

libappstream4パッケージを最新にすると直った

apt-get install --reinstall libappstream4

経緯は

  • ユーザーがapt-get updateを実行すると、appstreamがクラッシュする問題が発生
  • この問題は、appstreamのバージョン0.12.2-1で報告される
  • エラーは、appstreamcli refresh-cacheの実行時にGLib-CRITICALのアサーションが失敗することによって引き起こされる
  • 問題は重要度「important」として分類され、aptパッケージに影響を与える
  • バグはMatthias Klumppによって修正され、バージョン0.12.2-2で修正された

参考リンク