January 15Jan 15 ------------------------------------ 如何將Debian 13更新至最新狀態 ------------------------------------ 在執行系統更新前請確認: 已備份重要資料 (建議快照或完整備份) 若為遠端主機,請確認有備用登入方式 (例如主機商控制台) 生產環境建議先於測試機驗證更新 確認目前系統版本 uname -a ; lsb_release -a 預期輸出範例: Linux xxxxxx 6.12.86+deb13-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.86-1 (2026-05-08) x86_64 GNU/Linux No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 13 (trixie) Release: 13 Codename: trixie 檢查套件來源 cat /etc/apt/sources.list 來源應包含: deb http://ftp.hk.debian.org/debian/ trixie main contrib non-free non-free-firmware deb-src http://ftp.hk.debian.org/debian/ trixie main contrib non-free non-free-firmware deb http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware deb-src http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware # trixie-updates, to get updates before a point release is made; # see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports deb http://ftp.hk.debian.org/debian/ trixie-updates main contrib non-free non-free-firmware deb-src http://ftp.hk.debian.org/debian/ trixie-updates main contrib non-free non-free-firmware 若來源錯誤,更新可能失敗或安裝到非官方套件 ----------------------------------- 更新套件清單與檢視可升級套件 ----------------------------------- 更新套件清單 apt update -y 檢視可升級套件 apt list --upgradable 升級,升級過程中若出現設定檔覆蓋提示,建議保留原有設定 (按 N) 除非你清楚變更內容 apt upgrade -y ---------------- 確認升級完成 ---------------- 再次檢查是否還有可升級的套件,若顯示 Listing ... Done 代表已無可更新套件 apt list --upgradable ------------------ 清理系統垃圾 ------------------ 清除已下載的舊版套件快取 apt autoclean 移除不再需要的套件 apt autoremove 建議升級後執行,釋放磁碟空間並保持系統乾淨 ------------ 重開機 ------------ 重開機 (若核心或重要系統套件有更新) reboot 驗證更新結果,重開機後,再次檢查版本與核心 uname -a ; lsb_release -a -------------------- 檢視更新紀錄 -------------------- 檢查更新日誌 cat /var/log/apt/history.log 可查看: 更新時間 更新套件列表 操作者與操作指令 Edited Tuesday at 11:52 PM3 days by Jack
Create an account or sign in to comment