apt-get update 错误获取失败

apt-get update 错误获取失败

我正在尝试更新存储库但它显示此错误:

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/Release  Unable to find expected entry 'partner/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.

/etc/apt/sources.list看起来像这样:

> #############################################################
> ################### OFFICIAL UBUNTU REPOS ###################
> #############################################################
> 
> ###### Ubuntu Main Repos deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse deb-src
> http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe
> multiverse
> 
> ###### Ubuntu Update Repos deb http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse deb
> http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted
> universe multiverse deb http://us.archive.ubuntu.com/ubuntu/
> precise-backports main restricted universe multiverse deb-src
> http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted
> universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/
> precise-updates main restricted universe multiverse deb-src
> http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted
> universe multiverse
> 
> ###### Ubuntu Partner Repo
> # deb http://archive.canonical.com/ubuntu precise partner
> # deb-src http://archive.canonical.com/ubuntu precise partner
> 
> ###### Ubuntu Extras Repo
> # deb http://extras.ubuntu.com/ubuntu precise main
> # deb-src http://extras.ubuntu.com/ubuntu precise main
> # deb http://archive.ubuntu.com/ubuntu trusty main universe restricted multiverse
> # deb http://archive.ubuntu.com/ubuntu trusty-updates main universe multiverse restricted

答案1

您可以尝试删除sources.list并重新生成。但请先备份您的文件。

打开终端CTRLALTT

用此代码删除sources.list

sudo rm /etc/apt/sources.list

打开后software-properties-gtk

software-properties-gtk

这将打开并自动创建software-properties-gtk一个新的。sources.list

并勾选另一个复选框,它有助于重新生成 sources.list 文件。关闭时,它会要求您删除缓存。您sources.list现在可以检查您的文件了。

编辑: 另外,你可以使用网站重新生成sources.list文件。

相关内容