Kinaconの技術ブログ

Ubuntuはじめました。

Ubuntu16.04でapt updateできなかった

f:id:m-oota-711:20180824075049j:plain

新しいPCにubuntu16.04を入れた時のエラー
apt updateができなかった。

以下のサイトの対処方法で解決できた。
shimo lab: [日誌]ubuntuのappstreamcliの更新エラー


実行環境
・PC(HP Compaq Pro 6300 SFF
 OS:Ubuntu 16.04.5 LTS
 CPU: Core i5 3470
 メモリ: 4GB 
 GPU : GT 1030


作業内容

エラー

*** Error in `appstreamcli': double free or corruption (fasttop): 0x000000000291f080 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f54a46747e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f54a467d37a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f54a468153c]
/usr/lib/x86_64-linux-gnu/libappstream.so.3(as_component_complete+0x439)[0x7f54a49f9d19]
/usr/lib/x86_64-linux-gnu/libappstream.so.3(as_data_pool_update+0x44a)[0x7f54a49faf0a]
/usr/lib/x86_64-linux-gnu/libappstream.so.3(as_cache_builder_refresh+0x1c2)[0x7f54a49f0272]
appstreamcli(ascli_refresh_cache+0x12e)[0x4049de]
appstreamcli(as_client_run+0x6fb)[0x403ceb]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f54a461d830]
appstreamcli(_start+0x29)[0x403519]
======= Memory map: ========
00400000-00408000 r-xp 00000000 08:01 7077938                            /usr/bin/appstreamcli
00607000-00608000 r--p 00007000 08:01 7077938                            /usr/bin/appstreamcli
00608000-00609000 rw-p 00008000 08:01 7077938                            /usr/bin/appstreamcli
01e0a000-03a57000 rw-p 00000000 00:00 0                                  [heap]
7f5498000000-7f5498021000 rw-p 00000000 00:00 0 
︙

解決方法

sudo kill -KILL $(pgrep appstreamcli)

wget -P /tmp https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb

sudo dpkg -i /tmp/appstream_0.9.4-1ubuntu1_amd64.deb /tmp/libappstream3_0.9.4-1ubuntu1_amd64.deb
sudo apt update

以上。