ubuntu系統,關於源(source)的配置


1. 現象:(出現的錯誤)

執行 sudo apt-get update, 報錯:apt-get 404 Not Found Package Repository Errors

執行 sudo apt-get install, 報錯:Some index files failed to download They have been ignored, or old ones used

 

2. 解決方法:

(1)sudo cp  /etc/apt/sources.list    /etc/apt/sources.list_backup

(2)sudo gedit /etc/apt/sources.list

將下面的模板內容,復制粘貼到 /etc/apt/sources.list 文件里面后,保存就可以了:(我們使用的Ubuntu 是16.04)

deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse ##測試版源 deb http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse # 源碼 deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse ##測試版源 deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse


現在,再執行:

sudo apt-get update

現在就沒有“apt-get 404 Not Found Package Repository Errors” 問題了。

 

參考文獻:https://blog.csdn.net/github_35160620/article/details/52115542

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM