Product SiteDocumentation Site

6.6. 升級至下個穩定發行版

Debian 知名的功能之一是可升級至下個穩定版:dist-upgrade — 知名的句子 — 相當促進 Debian 的名聲。除了極少的例外,升級電腦系統祗需幾分鐘的時間,或暫十來分鐘,依照從套件儲存庫下載的速度而定.

6.6.1. 建議程序

Debian 各穩定版之間存在相當的差異,升級前應仔細閱讀釋出說明。
In this section, we will focus on upgrading a Jessie system to Stretch. This is a major operation on a system; as such, it is never 100% risk-free, and should not be attempted before all important data has been backed up.
減少安裝的套件,祗安裝絕對必要的套件,才能讓升級容易 (且簡短)。相關的工具包括 aptitudedeborphandebfoster (見 節 6.2.7, “自動追蹤已安裝的套件”)。例如,您可使用以下命令,再使用 aptitude 的互動模式再檢查並微調該移除的套件:
# deborphan | xargs aptitude --schedule-only remove
Now for the upgrading itself. First, you need to change the /etc/apt/sources.list file to tell APT to get its packages from Stretch instead of Jessie. If the file only contains references to Stable rather than explicit codenames, the change isn't even required, since Stable always refers to the latest released version of Debian. In both cases, the database of available packages must be refreshed (with the apt update command or the refresh button in synaptic).
註冊這些新增的套件來源後,首先執行最低量的升級 apt upgrade。以兩階段升級,減緩套件管理工具的工作並確保使用最新的套件,納入完整發行版升級所需的錯誤更正與改進。
Once this first upgrade is done, it is time to handle the upgrade itself, either with apt full-upgrade, aptitude, or synaptic. You should carefully check the suggested actions before applying them: you might want to add suggested packages or deselect packages which are only recommended and known not to be useful. In any case, the front-end should come up with a scenario ending in a coherent and up-to-date Stretch system. Then, all you need is to do is wait while the required packages are downloaded, answer the Debconf questions and possibly those about locally modified configuration files, and sit back while APT does its magic.

6.6.2. 處理升級後的問題

僅管 Debian 管理者已經儘力做好份內的工作,主系統的升級仍可能卡卡的不如想像中順利。軟體的新版本可能無法與舊的相容 (例如,可能改變預設行為或資料格式)。同時,儘管在 Debian 釋出前做為詳盡的測試,還是有若干漏網的錯誤。
可以先安裝 apt-listchanges package, 套件,在套件升級前先顯示可能問題。由套件維護者編輯的這些資訊且置於 /usr/share/doc/套件名/NEWS.Debian 檔案名內,供使用者參考。閱讀該等檔案 (可能經由 apt-listchanges) 應有助於歸避不好的意外。
新版的軟體不見得都能順利運作。不夠普及或未經詳實測試就會出現這種現象;在穩定版裡,最後升級的軟體常常後悔。碰到這種情形,首先應查看錯誤追蹤系統 https://bugs.debian.org/套件名稱,尋找別人提報的踪跡。若尚未被提報,就應動手提報它 reportbug。若已被提報,錯誤報告與相關的訊息就是處理該錯誤很好的資訊來源:
  • 有時已有補丁,並且列在錯誤報告內;可以在地重新編譯修補破碎的套件 (見 節 15.1, “Rebuilding a Package from its Sources”);
  • 否則,使用者可能找到另個解決問題的方法且在報告內分享;
  • 再不然,維護者可能已準備並公開修訂套件。
很嚴重的錯誤,將有特別的套件供穩定版使用。在這種情況下,修訂後的套件位於 Debian 鏡射站的 proposed-updates 區塊 (見 節 6.1.2.3, “建議更新”)。對應的款目暫時加在 sources.list 檔案內,可用 aptaptitude 命令安裝升級套件。
修訂套件尚未被穩定版管理者認可時,就不會出現在此區塊。使用者必須自己動手認可它。雖然列在此的套件尚未可得,但至少已知在審查中。