2
$ gnome-language-selector
Traceback (most recent call last):
  File "/usr/bin/gnome-language-selector", line 22, in on_activate
    options=options)
  File "/usr/lib/python3/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 199, in __init__
    self.updateLanguageView()
  File "/usr/lib/python3/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 712, in updateLanguageView
    self.openCache(progress)
  File "/usr/lib/python3/dist-packages/LanguageSelector/LanguageSelector.py", line 33, in openCache
    self._cache = LanguageSelector.LangCache.LanguageSelectorPkgCache(self._localeinfo, progress)
  File "/usr/lib/python3/dist-packages/LanguageSelector/LangCache.py", line 76, in __init__
    apt.Cache.__init__(self, progress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 113, in __init__
    self.open(progress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 164, in open
    self._cache = apt_pkg.Cache(progress)
SystemError: E:Unable to parse package file /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_xenial-backports_main_binary-amd64_Packages (1), E:Encountered a section with no Package: header, E:Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_xenial-backports_main_binary-i386_Packages, E:The package lists or status file could not be parsed or opened.

Im trying to install Chinese as an additional language on my system.

Distributor ID: Ubuntu Description: Ubuntu 16.04 LTS Release: 16.04 Codename: xenial

After clicking on "Language Support" in System Settings, i see a new window open "Checking available language support" but after 3 seconds it closes and nothing happens.

After inputting this in command line:

sudo apt-get -y install `check-language-support -l zh

I get this error message...

Traceback (most recent call last):
  File "/usr/bin/check-language-support", line 53, in <module>
    ls = language_support_pkgs.LanguageSupport(None, pkg_depends)
  File "/usr/lib/python3/dist-packages/language_support_pkgs.py", line 13, in __init__
    self.apt_cache = apt.Cache()
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 113, in __init__
    self.open(progress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 164, in open
    self._cache = apt_pkg.Cache(progress)
SystemError: E:Unable to parse package file /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_xenial-backports_main_binary-amd64_Packages (1), E:Encountered a section with no Package: header, E:Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_xenial-backports_main_binary-i386_Packages, E:The package lists or status file could not be parsed or opened.
Reading package lists... Error!
E: Unable to parse package file /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_xenial-backports_main_binary-amd64_Packages (1)
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_xenial-backports_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.

How do I install Chinese? Why am I getting these error messages? How do i fix? Thank you to anyone who can help.

marked as duplicate by Byte Commander, Gunnar Hjalmarsson, Zanna, karel, Eric Carvalho Mar 27 '17 at 12:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Ok, I think you should run the commands suggested in the answer which Byte Commander pointed at:

sudo rm /var/lib/apt/lists/*
sudo apt update

EDIT

In simple terms for some reason you got malformed files in the cache during updates and what this solution does is to clean the cache and get new information, therefore removing the malformed files.

  • thanks. it worked!!! wish i could explain why or how, but ill take it. thanks – adamearl Mar 26 '17 at 19:13
  • if you want to remove that lists, what I think seems to be a good solution you need to do it recursively, because it is a folder using sudo rm -r /var/lib/apt/lists/* and than update and try again. – starkus Mar 26 '17 at 20:10
  • @starkus: That works too. Usually the partial folder is empty, and most suggestions at Ask Ubuntu and other places don't suggest to do it recursively. Unclear to me what's the 'right' way. – Gunnar Hjalmarsson Mar 26 '17 at 20:20
  • Sorry. I didn't read that you got it already solved before writing my message. I just tried it the described way and got an error shown and thought to tell it here. The error is just because of the containing folders of the folder. Maybe they don't need to be cleared too. I don't know... – starkus Mar 26 '17 at 21:24
  • this is even worse :( – Ender Apr 23 at 8:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.