Ubuntu 16.04でアップデートが出来ない不具合に対処する
Ubuntu 16.04で「ソフトウェアの更新」や「sudo apt-get update」などを実行すると、それらがフリーズしてCPU使用率が跳ね上がってしまう。
- Bug #1579712 “Refresh hangs indefinitely, appstreamcli using 100...” : Bugs : appstream package : Ubuntu
- Comment #30 : Bug #1579712 : Bugs : appstream package : Ubuntu
appstreamcliが暴走するバグらしい。一応Fix Releasedにはなっているがまだproposed(一般のユーザーがインストールできるようにはなっていない状態)なので、手動でアップデートする必要がある。
appstreamcliを強制終了するかUbuntuを再起動した後、端末を起動して以下のコマンドを実行する。
Ubuntuが64ビットの場合
cd /tmp/ wget https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb wget https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb sudo mv /etc/apt/apt.conf.d/50appstream /etc/apt/apt.conf.d/50appstream.disabled sudo dpkg -i *.deb sudo mv /etc/apt/apt.conf.d/50appstream.disabled /etc/apt/apt.conf.d/50appstream
Ubuntuが32ビットの場合は未確認だけど以下でいけるはず。
Ubuntuが32ビットの場合
cd /tmp/ wget https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_i386.deb wget https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_i386.deb sudo mv /etc/apt/apt.conf.d/50appstream /etc/apt/apt.conf.d/50appstream.disabled sudo dpkg -i *.deb sudo mv /etc/apt/apt.conf.d/50appstream.disabled /etc/apt/apt.conf.d/50appstream
これで「ソフトウェアの更新」や「sudo apt-get update」が正常に動作するようになる。