Blame
|
1 | # Ubuntu 系统升级 |
||||||
| 2 | ||||||||
| 3 | 之前在天翼云薅了几台云主机,但是镜像只有 Ubuntu 20.04 的版本,为了使用新版本,升! |
|||||||
| 4 | ||||||||
| 5 | 查看当前 Ubuntu 版本 |
|||||||
| 6 | ||||||||
| 7 | ```sh |
|||||||
| 8 | lsb_release -a |
|||||||
| 9 | ``` |
|||||||
| 10 | ||||||||
| 11 | [预览图](https://static.qwas.fun/public/2024/11/ubuntu-20-04-6.png) |
|||||||
| 12 | ||||||||
| 13 | ```sh |
|||||||
| 14 | echo "8.217.88.233 mirrors.ubuntu.com" >> /etc/hosts |
|||||||
| 15 | echo "8.217.88.233 archive.ubuntu.com">> /etc/hosts |
|||||||
| 16 | echo "8.217.88.233 security.ubuntu.com">> /etc/hosts |
|||||||
| 17 | ``` |
|||||||
| 18 | ||||||||
| 19 | ```sh |
|||||||
| 20 | apt update |
|||||||
| 21 | apt upgrade -y |
|||||||
| 22 | ``` |
|||||||
| 23 | ||||||||
| 24 | ```sh |
|||||||
| 25 | do-release-upgrade |
|||||||
| 26 | ``` |
|||||||
| 27 | 中间需要多次确认,新机子,无脑点 `Y`,不出意外的话,大约耗费半个小时,系统成功升级到 22.04。 |
|||||||
| 28 | ||||||||
| 29 | 然而 `do-release-upgrade` 只能升级一个版本,于是再来一遍 `do-release-upgrade` |
|||||||
| 30 | ||||||||
| 31 | [预览图](https://static.qwas.fun/public/2024/11/ubuntu-24-04-1.png) |
|||||||
| 32 | ||||||||
| 33 | ## 注意 |
|||||||
| 34 | ||||||||
|
35 | 升级过程中,会自动启用 screen. 如因为网络原因,ssh断开了连接,重新连接 ssh 后,`screen -r id` 恢复终端。如遇到 `Attached` 无法恢复 `screen -d id` 断开后,重新 `screen -r id` |
||||||
| 36 | ||||||||
| 37 | [screen 预览图](https://static.qwas.fun/public/2024/11/screen.png) |
|||||||