Product SiteDocumentation Site

6.7. 保持系統在最新狀態

Debian 發行版永遠處於動態、持續變化中。大部份的變化在 測試版不穩定版 中,即使是 穩定版 也隨時在更新中,主要是安全相關的修訂。不論執行那個版本,都需保持在最新的版本,才能用到最新的狀態及修訂錯誤。
第一個工具是 apticron,位於同名套件中。主要作用是每日執行一個腳本 (經由 cron)。這個腳本更新可用套件清單,若已安裝的套件不在此清單內,則發送電子郵件列出該等套件清單,並指出在新版中可用的套件。明顯地,此套件的對象是 Debian 穩定版 的使用者,對其他版本的使用者而言,此清單太長了。取得可更新清單後,apticron 自動下載它們。不會安裝它們 — 那是管理者的權限與工作 — 但已下載的套件可以在地 (於 APT 快取內) 安裝,速度快多了。
Administrators in charge of several computers will no doubt appreciate being informed of pending upgrades, but the upgrades themselves are still as tedious as they used to be. Periodic upgrades can be enabled: it uses a systemd timer unit or cron. If systemd is not installed the /etc/cron.daily/apt-compat script (in the apt package) comes in handy. This script is run daily (and non-interactively) by cron. To control the behavior, use APT configuration variables (which are therefore stored in a file /etc/apt/apt.conf.d/10periodic). The main variables are:
此選項允許您指定重新載入的頻率。apticron 也可以在無變數的前提下執行,因為 apticron 本來就已在執行中。
再次地,此選項指定頻率 (以日計),此時實際地下載套件。同樣地,使用者不需指定執行 apticron
此選項包括 apticron 沒有的功能。指定過時套件 (未被任何發行版參照) 移出 APT 快取的時機。如此一來,APT 快取的容量就保持在合理的範圍,不必再擔心其工作負擔。
啟用此選項後,逐日啟用的腳本將執行 unattended-upgrade (從 unattended-upgrades 套件中取用) — 如其名稱所示 — 可自動化升級同套件 (預設祗執行安全性升級,但可在 /etc/apt/apt.conf.d/50unattended-upgrades 內客製化它)。執行 dpkg-reconfigure -plow unattended-upgrades 時可以設定此選項。
Other options can allow you to control the cache cleaning behavior with more precision. They are not listed here, but they are described in the /usr/lib/apt/apt.systemd.daily script.
These tools work very well for servers, but desktop users generally prefer a more interactive system. The package gnome-packagekit provides an icon in the notification area of desktop environments when updates are available; clicking on this icon then runs gpk-update-viewer, a simplified interface to perform updates. You can browse through available updates, read the short description of the relevant packages and the corresponding changelog entries, and select whether to apply the update or not on a case-by-case basis.
使用 gpk-update-viewer 升級

圖形 6.3. 使用 gpk-update-viewer 升級

This tool is no longer installed in the default GNOME desktop. The new philosophy is that security updates should be automatically installed, either in the background or, preferably, when you shutdown your computer so as to not confuse any running application.