我在 Ubuntu 中遇到一个问题,打开缓存时出错,无法在我的文件中读取软件源列表/etc/apt/sources.list
,无法解析或打开包列表或状态文件。我是 Ubuntu 新手,所以我无法确定是什么导致了这个问题。我在打开 Ubuntu 软件中心时也遇到了问题,一旦我注释掉第 56 行deb http://archive.canonical.com/raring partner
,Ubuntu 软件中心就会正常打开。问题可能出在哪里?我从 sources.list 文件中包含了 4 行。
我的第 56 行的 Source.list 代码是这样的:
deb http://archive.canonical.com/raring partner
# deb-src http://archive.canonical.com/raring partner
# deb-src http://archive.canonical.com/raring partner
# deb-src http://archive.canonical.com/raring partner
终端输出:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/gi/overrides/GLib.py", line 629, in <lambda>
return (lambda data: callback(*data), user_data)
File "/usr/share/software-center/softwarecenter/db/pkginfo_impl/aptcache.py", line 261, in open
self._cache = apt.Cache(progress)
File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 105, in __init__
self.open(progress)
File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 150, in open
self._cache = apt_pkg.Cache(progress)
SystemError: E:Malformed line 56 in source list /etc/apt/sources.list (dist parse), E:The list of sources could not be read., E:The package lists or status file could not be parsed or opened.
2014-01-22 11:27:29,685 - softwarecenter.db.pkginfo_impl.aptcache - INFO - aptcache.open()
答案1
由于您对源进行了更改,因此您应该进行更新apt
以便识别这些更改。
为此,打开终端(按Ctrl+ Alt+ T)并输入命令:
sudo apt-get update
你就完成了。