可能是错误的发布文件导致apt-get更新失败

Sro*_*rol 2 ubuntu ubuntu-14.04

我在我的电脑上安装了Ubuntu 14.04的虚拟机.

当我跑步时sudo apt-get update,我收到回复:

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/Release  Unable to find expected entry 'restricted/source/Sources' 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.
Run Code Online (Sandbox Code Playgroud)

我试图重新安装VM,它没有解决问题.

提前致谢!

Sne*_*kar 10

对于仍然面临此问题的人,以下是一些可能的解决方案(最后一个解决问题,以防其他失败):

1.删​​除缓存的文件:

sudo rm /var/lib/apt/lists/* -vf
Run Code Online (Sandbox Code Playgroud)

如果需要,也可以使用以下文件partials:

sudo rm /var/lib/apt/lists/partials/* -vf
Run Code Online (Sandbox Code Playgroud)

然后试试 sudo apt-get update

2.修改sources.list:

您可以编辑/etc/apt/sources.list对存储库名称列表进行必要的更改.如果sources.list以某种方式被破坏,那么你可以删除它并生成一个新的.在这方面,可能会有很大帮助.

3.选择其他服务器:

转到Software & Updates- > Ubuntu Software.从Download from,选择other...并选择与上一个不同的优选服务器.您可以单击Select Best Server并让系统为您选择最佳服务器.更改服务器后,系统将提示您刷新.最后,sudo apt-get update此后应该工作正常.

注意:我遇到了第3个解决方案解决的问题.我也无法从下载一些应用程序Terminal,并Ubuntu Software Center为好.