更新时“无法获取”
我最近试图从ubuntu 12.10更新,但我不断收到“无法获取”错误。
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/quantal-security/Release Unable to find expected entry 'independent/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file) W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/quantal/Release Unable to find expected entry 'independent/source/Sources' in Release file (Wrong sources.list entry or malformed file) W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/quantal-updates/Release Unable to find expected entry 'independent/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file) W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/quantal-backports/Release Unable to find expected entry 'independent/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file) E: Some index files failed to download. They have been ignored, or old ones used instead.
我更改了服务器并从/var/lib/apt/lists/
删除了源列表,但是仍有一些答案。 这真的很烦人。
消息
(错误的sources.list条目或格式错误的文件)
表示sources.list
文件中的某些条目错误或行格式错误。
搜索了网络,我发现了这个旧的bug ,它不是很老,但已经过期了 。
解决方案(解决方法是更好的词)是检查您的sources.list
文件并删除独立于行的单词。 试试吧。
查看所有 sources.list
条目的详细命令如下:
find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;
对于未来为更新版本的Ubuntu而来的人,NikTh的答案有效,但你想搜索商业而不是独立 。
这为我解决了这个问题。
我有同样的问题,我通过测试软件和更新应用程序中的最佳服务器更改了服务器名称,然后进行了sudo apt-get更新。 工作就像一个魅力。