树莓派/var/lib/apt/extended_states修错修复

在树莓派上安装软件,发现无法正常执行apt-get反馈以下错误:

E: 无法解析软件包文件 /var/lib/apt/extended_states (1)

E: Unable to parse package file /var/lib/apt/extended_states (1)

修复方法

sudo mv /var/lib/apt/extended_states /var/lib/apt/extended_states_tmp
# 文件改名
# 或:
sudo rm /var/lib/apt/extended_states
# 删除

参考链接:https://sathyasays.com/2009/11/08/how-to-fix-e-unable-to-parse-package-file-varlibaptextended_states-1-error-in-synaptic-or-apt-get/

附原文:

This is just a quick tip. If you are getting this error message in Synaptic:

E: Unable to parse package file /var/lib/apt/extended_states (1)

E: _cache->open() failed, please report

or this error in apt-get in command line:

Reading package lists… Done

Building dependency tree

Reading state information… Error!

E: Unable to parse package file /var/lib/apt/extended_states (1)

and both just fail to open or install, then just execute this in command line (terminal):

sudo mv /var/lib/apt/extended_states /var/lib/apt/extended_states_tmp

You are done. Thanks to this post