前言
目前國內雲服務商提供的鏡像最新只有 9 , 本文講解升級至 10 的方法
正文
查看當前版本
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.0 (stretch)
Release: 9.0
Codename: stretch
現在的版本是9.0
更新到當前版本的最新版
apt-get update
apt-get upgrade
apt-get dist-upgrade
過程中如有提醒讓選擇方式
install the package maintainer's version
keep the local version currently installed
show the differences between the versions
我們選擇第一個
修改apt源為10
sed -i 's/stretch/buster/g' /etc/apt/sources.list
strech 為 debian9 代號, 將其替換為 buster 為 debian10 代號
更新apt索引
apt-get update
升級到debian10
apt-get upgrade
apt-get dist-upgrade
出現選項選擇 yes
出現多個選項選擇 選項一
重啟
重啟系統
reboot
驗證版本
lsb_release -a
清理老版本軟件
apt-get autoremove
其他
更新到testing
testing版本為測試版本, 他的 apt 倉庫是更新的, 一般也很穩定了
需要注意,為了減少問題出現,務必先更新到當前最新穩定版再更新testing
sed -i 's/buster/testing/g' /etc/apt/sources.list
然后執行 apt-get update
如果出現 404 代表你配置的鏡像源沒有此鏡像, 國內推薦 USTC
vim /etc/apt/sources.list
將原有內容去除,添加為
deb http://mirrors.ustc.edu.cn/debian/ testing main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian/ testing main contrib non-free
deb http://mirrors.ustc.edu.cn/debian/ testing-updates main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian/ testing-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian-security/ testing-security main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian-security/ testing-security main contrib non-free
執行
apt-get update
apt-get upgrade
apt-get dist-upgrade
重啟
reboot
查看版本
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux bullseye/sid
Release: testing
Codename: bullseye
清理老的軟件
apt-get autoremove