apt-get更新錯誤無法取得

apt-get更新錯誤無法取得

我正在嘗試更新存儲庫,但它顯示此錯誤:

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檔案。

相關內容