(1)當前系統爲非長期支持版,並且已被廢棄,只能逐版本升級
以當前系統版本爲11.10爲例
修改source.list更新源爲通用old源,因爲原來的源已經不可用
deb http://old-releases.ubuntu.com/ubuntu/ oneiric main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric main restricted
將oneiric換爲當前系統版本代號,代號可用lsb_release -a 命令查看
apt-get update
apt-get install update-manager-core
do-release-upgrade
即可升級到緊鄰的更高版本12.04
tips:若是尚未被廢棄的版本可以跳過修改source.list步驟
以從12.04升級到14.04爲例
將source.list 中的源替換爲速度比較快的14.04版本國內源,如163源,或者覺得自己的源已經夠快可以直接在source.list中把12.04的版本代號修改爲14.04的版本代號trusty
apt-get update
apt-get dist-upgrade
tips:apt-get update返回NO_PUBKEY錯誤的解決方法:
apt-key
adv --recv-keys --keyserver keyserver.ubuntu.com 354FE6ACC0521F32
將key值替換即可
其他情況請以以上兩種方法爲依據靈活操作