Debian 12 Bookworm 已經發布。如果你正在使用 Debian 11 "Bullseye",那麼現在可以考慮升級你的電腦或伺服器了。但是,建議你等待 Debian “Bookworm” 的第一個小版本,即 12.1 版本,再進行關鍵伺服器升級。
話雖如此,如果你想了解 Debian 12 的新特性,可以看看 這篇文章。以下是詳細的升級步驟:
從 Debian 11 升級到 Debian 12
無論你運行的是 Debian 伺服器還是任何桌面版本,請確保備份關鍵資料。例如,你可能需要為桌面文件進行備份。如果是伺服器,請記錄正在運行的服務。你可以使用 rsync
或其他實用工具來完成此動作。
Debian 12 引進了一個名為 non-free-firmware
的新倉庫,用於專有驅動程式和軟體套件。如果你使用任何「閉源」的網路、顯示、圖形或其他驅動程序,你可能需要在升級後進行配置。
對於網路驅動程式,請確保在某個地方安全地記錄 /etc/network/interfaces
和 /etc/resolv.conf
檔案的內容。如果升級完成後失去了網路連接,可以 按照這個指南 輕鬆設定它。
從命令提示字元執行以下命令,以確保Debian 11 更新了安全性和其他軟體包:
sudo apt updatesudo apt upgradesudo apt full-upgradesudo apt autoremove
完成上述命令後,重新啟動Debian 11 系統:
sudo systemctl reboot
記下關於Debian 11 的幾個資訊。這對於伺服器很重要。它們包括內核版本和 Debian 版本。這是因為升級後,你可以驗證下面的相同命令以確保升級成功。
例如,我嘗試升級的系統是 Debian 11.7,核心版本為 5.10。
uname -mr
範例輸出:
5.10.0-23-amd64 x86_64
cat /etc/debian_version
範例輸出:
11.7
將APT 原始檔備份到你選擇的任何目錄:
sudo cp -v /etc/apt/sources.list /home/arindam/sudo cp -vr /etc/apt/sources.list.d/ /home/arindam/
#開啟 /etc/apt/sources.list
文件,並將Debian 12 的代號 bookworm
加入該文件中,取代 bullseye
。
sudo nano /etc/apt/sources.list
以下是我測試系統中的 /etc/apt/sources.list
檔案更改先前的內容作為參考:
deb http://deb.debian.org/debian/ bullseye maindeb-src http://deb.debian.org/debian/ bullseye maindeb http://security.debian.org/debian-security bullseye-security maindeb-src http://security.debian.org/debian-security bullseye-security maindeb http://deb.debian.org/debian/ bullseye-updates maindeb-src http://deb.debian.org/debian/ bullseye-updates main
以下是更改後的 /etc/apt/sources.list
檔案。以下鏡像網址是預設設定。如果你使用不同的Debian 映像,請不要更改它們:
deb http://deb.debian.org/debian/ bookworm maindeb-src http://deb.debian.org/debian/ bookworm maindeb http://security.debian.org/debian-security bookworm-security maindeb-src http://security.debian.org/debian-security bookworm-security maindeb http://deb.debian.org/debian/ bookworm-updates maindeb-src http://deb.debian.org/debian/ bookworm-updates maindeb http://deb.debian.org/debian bookworm non-free non-free-firmwaredeb-src http://deb.debian.org/debian bookworm non-free non-free-firmwaredeb http://deb.debian.org/debian-security bookworm-security non-free non-free-firmwaredeb-src http://deb.debian.org/debian-security bookworm-security non-free non-free-firmwaredeb http://deb.debian.org/debian bookworm-updates non-free non-free-firmwaredeb-src http://deb.debian.org/debian bookworm-updates non-free non-free-firmware
#更新原始檔案
##注意:從Debian 12 “Bookworm” 開始,Debian 團隊創建了一個新的倉庫 non-free-firmware 來打包非自由的軟體包。因此,在上面的範例中最後三個部分中也包含了它們。
sudo apt updatesudo apt full-upgrade
#
升级过程
Debian 12 升级过程进行中
在升级过程中,安装程序可能会要求你重新启动几个服务。仔细阅读消息后点击 “Yes”。另外,如果你看到带有 :
的提示,请按 q
键退出该消息。
确认服务验证
等待软件包下载和安装完成。
升级完成后,请重新启动你的 Debian 桌面或服务器:
sudo systemctl reboot
检查升级状态
重启后,请验证你是否正在运行 Debian 12。可以使用以下文件检查 Debian 版本:
cat /etc/debian_version
示例输出:
Debian 12 Bookworm Desktop (Xfce)
此外,如果你刚刚升级到 Debian 12 服务器,请确保验证正在运行的服务,例如 HTTP、SSH 等。你可以使用以下 systemd 命令 了解正在运行的服务:
systemctl list-units --type=service
总结和清理
在确认所有步骤都已完成后,你可能希望运行 apt autoremove
命令来清理不需要的软件包。但是,请在执行此操作时格外小心。
sudo apt --purge autoremove
这就是升级到 Debian 12 的简要步骤。希望你的升级顺利进行。请勿立即将关键的 Debian 11 服务器升级,等待 Debian 12.1 发布后再行操作。
有关 Debian 升级的更多信息,请访问 官方文档。
最后,请别忘了告诉我们你的升级情况。
以上是從 Debian 11 升級到 Debian 12的詳細內容。更多資訊請關注PHP中文網其他相關文章!

確認 Nginx 是否啟動的方法:1. 使用命令行:systemctl status nginx(Linux/Unix)、netstat -ano | findstr 80(Windows);2. 檢查端口 80 是否開放;3. 查看系統日誌中 Nginx 啟動消息;4. 使用第三方工具,如 Nagios、Zabbix、Icinga。

要關閉 Nginx 服務,請按以下步驟操作:確定安裝類型:Red Hat/CentOS(systemctl status nginx)或 Debian/Ubuntu(service nginx status)停止服務:Red Hat/CentOS(systemctl stop nginx)或 Debian/Ubuntu(service nginx stop)禁用自動啟動(可選):Red Hat/CentOS(systemctl disable nginx)或 Debian/Ubuntu(syst

如何在 Windows 中配置 Nginx?安裝 Nginx 並創建虛擬主機配置。修改主配置文件並包含虛擬主機配置。啟動或重新加載 Nginx。測試配置並查看網站。選擇性啟用 SSL 並配置 SSL 證書。選擇性設置防火牆允許 80 和 443 端口流量。

服務器無權訪問所請求的資源,導致 nginx 403 錯誤。解決方法包括:檢查文件權限。檢查 .htaccess 配置。檢查 nginx 配置。配置 SELinux 權限。檢查防火牆規則。排除其他原因,如瀏覽器問題、服務器故障或其他可能的錯誤。

在 Linux 中啟動 Nginx 的步驟:檢查 Nginx 是否已安裝。使用 systemctl start nginx 啟動 Nginx 服務。使用 systemctl enable nginx 啟用在系統啟動時自動啟動 Nginx。使用 systemctl status nginx 驗證啟動是否成功。在 Web 瀏覽器中訪問 http://localhost 查看默認歡迎頁面。

在 Linux 中,使用以下命令檢查 Nginx 是否已啟動:systemctl status nginx根據命令輸出進行判斷:如果顯示 "Active: active (running)",則 Nginx 已啟動。如果顯示 "Active: inactive (dead)",則 Nginx 已停止。

問題的答案:304 Not Modified 錯誤表示瀏覽器已緩存客戶端請求的最新資源版本。解決方案:1. 清除瀏覽器緩存;2. 禁用瀏覽器緩存;3. 配置 Nginx 允許客戶端緩存;4. 檢查文件權限;5. 檢查文件哈希;6. 禁用 CDN 或反向代理緩存;7. 重啟 Nginx。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

MantisBT
Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。

Atom編輯器mac版下載
最受歡迎的的開源編輯器

SublimeText3 Linux新版
SublimeText3 Linux最新版

DVWA
Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中

mPDF
mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),