软件中心根本无法打开错误

软件中心根本无法打开错误

当我从菜单打开软件时,它说“无法打开软件数据库。请重新安装软件中心包。当我在终端上写入软件中心时,出现这样的错误:

2014-05-28 09:11:20,584 - softwarecenter.ui.gtk3.app - INFO - setting up proxy 'None'
2014-05-28 09:11:20,593 - softwarecenter.ui.gtk3.app - ERROR - xapian open failed
Traceback (most recent call last):
File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 302, in __init__
if self.db.schema_version() != DB_SCHEMA_VERSION:
File "/usr/share/software-center/softwarecenter/db/database.py", line 289, in schema_version
return self.xapiandb.get_metadata("db-schema-version")
File "/usr/share/software-center/softwarecenter/db/database.py", line 177, in xapiandb
self._db_per_thread[thread_name] = self._get_new_xapiandb()
File "/usr/share/software-center/softwarecenter/db/database.py", line 190, in _get_new_xapiandb
xapiandb = xapian.Database(self._db_pathname)
File "/usr/lib/python2.7/dist-packages/xapian/__init__.py", line 3667, in __init__
_xapian.Database_swiginit(self,_xapian.new_Database(*args))
DatabaseCorruptError: /var/cache/software-center/xapian/iamchert: Chert version file should be 28 bytes, actually 0

现在,当我写命令时sudo apt-get remove software-center

dpkg: error: corrupt info database format file '/var/lib/dpkg/info/format'
E: Sub-process /usr/bin/dpkg returned an error code (2)

我以前用过 ubuntu,但它有点损坏了。现在,我刚刚重新安装了它,即使在启动时,软件中心也无法打开,并且出现此错误。希望您有解决方案。谢谢。

答案1

缓存文件已损坏。要重新生成它,请打开终端并输入以下内容:

sudo rm -r /var/cache/software-center/xapian
sudo mv /var/lib/dpkg/info/format /var/lib/dpkg/info/format.bak
sudo dpkg --clear-avail
sudo apt-get update
sudo apt-get install --reinstall software-center

答案2

同时按下 CTRL+ ALT+T进入终端。

要卸载软件中心:

  1. sudo apt-get remove software-center

  2. sudo apt-get autoremove software-center

要重新安装软件中心:

  1. sudo apt-get update

  2. sudo apt-get install software-center -y

相关内容