如果有 Error 會造成無法使用 apt-get install 新的 package, 也會造成無法使用 do-release-upgrade 來升級系統。
apt-get 的 error message:
E: Some index files failed to download. They have been ignored, or old ones used instead
我試過把 /etc/apt/sources.list 先備分之後,再重新下載sources.list,結果一樣。
apt-get update 會失敗,do-release-upgrade 也會失敗。
解法:
刪掉 sources.list,建立新的 sources.list 並使用下面的檔案內容。
If your release has reached end of life (EOL), you need to modify /etc/apt/sources.list as follows, in order to avoid 404 errors during apt-get update. Replace CODENAME with the codename of Ubuntu release that you are using.
deb http://old-releases.ubuntu.com/ubuntu/ CODENAME main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-updates main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu/ CODENAME-security main restricted universe multiverse
附註:deb 並不是指令,而是用來放到 sources.list 的設定用的參數。
我的ubuntu 是 15.10 已過 end of life (EOL),所以我的設定值是:
deb http://old-releases.ubuntu.com/ubuntu/ wily main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu/ wily-updates main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse