
我想升級我的 Debian 系統,但被告知我需要先更新現有的儲存庫 (Stretch),然後再執行此操作。不幸的是,這不起作用,因為拉伸已被存檔,所以我的sources.list不起作用。我嘗試了各種線路組合,試圖使更新工作失敗。關於相同主題的其他貼文僅提供有關sources.list 中必要行的零碎資訊。有人可以告訴我要使用的確切線路嗎?以下是我所擁有的內容和報告的錯誤:
deb http://security.debian.org/debian-securitystretch/updates main deb-src http://archive.debian.org/debian-securitystretch/updates 主要貢獻非免費 deb http://archive.debian.org/debianstretch-updates 主要貢獻非免費 deb-src http://archive.debian.org/debianstretch-updates 主要貢獻非免費
錯誤:
W:儲存庫「http://security.debian.org/debian-securitystretch/updatesRelease」沒有發佈檔案。 N:來自此類儲存庫的資料無法進行身份驗證,因此使用時存在潛在危險。 N:有關儲存庫建立和使用者配置詳細信息,請參閱 apt-secure(8) 線上說明頁。 E:儲存庫「http://deb.debian.org/debianstretchRelease」不再有發佈檔案。 N:從這樣的儲存庫進行更新無法安全地完成,因此預設會被停用。
答案1
根據錯誤訊息,問題出在兩行不是指archive.debian.org
.
第一個問題行:
deb http://security.debian.org/debian-security stretch/updates main
自從對 Debian Stretch 的定期安全支援結束2020 年 7 月 18 日。你現在應該註解掉這一行:當您仍在執行 Debian Stretch 時,它沒有進一步的用途,但是一旦您升級到較新的主要版本(兩次),它就可以取消註釋並更新以指向該版本的安全性更新儲存庫。
若要接收 Stretch 9.13 最新版本中未合併的任何安全性更新,您應該新增以下行:
deb [trusted=yes] http://archive.debian.org/debian-security stretch/updates main
您可能需要[trusted=yes]
在 archive.debian.org 中新增任何引用 Stretch 的行,因為用於簽署 Stretch 套件的 GPG 金鑰現在很可能都已過期。添加該內容應該會將有關過期密鑰的錯誤訊息更改為警告,並允許您繼續更新。
根據錯誤訊息的第二個問題行在您的sources.list
程式碼片段中不可見,但我可以推斷它可能是:
deb http://deb.debian.org/debian stretch main contrib non-free
該行可能位於目錄中的文件之一/etc/apt/sources.list.d/
。你應該將其更改為:
deb [trusted=yes] http://archive.debian.org/debian stretch main contrib non-free
deb
您的程式碼片段中的行涵蓋sources.list
了安全性和其他更新,但不是主要發佈內容;這條線將涵蓋這一點。
如果您不需要*.deb
從原始程式碼建立任何套件,則可以註解掉這些deb-src
行。
請記住,不支援跳過主要版本,因此一旦您完全更新到 Stretch 9.13,您應該對 Debian 10“Buster”進行重大升級,直到今年 6 月底,它仍然具有長期支援年。如果/執行升級時,請記住注意發行說明中的升級說明。
從那時起,下一步應該是 Debian 11“Bullseye”,它是當前版本oldstable
,直到今年 7 月底仍然提供定期安全支持,並在此後兩年提供長期支持。
答案2
您需要的線路是
deb http://archive.debian.org/debian stretch main
deb http://archive.debian.org/debian-security stretch/updates main
如果您需要contrib
和non-free
,請將它們新增到兩行的末尾。