惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
P
Proofpoint News Feed
Apple Machine Learning Research
Apple Machine Learning Research
WordPress大学
WordPress大学
博客园 - Franky
V
V2EX
爱范儿
爱范儿
J
Java Code Geeks
小众软件
小众软件
Last Week in AI
Last Week in AI
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
酷 壳 – CoolShell
酷 壳 – CoolShell
The Register - Security
The Register - Security
GbyAI
GbyAI
Vercel News
Vercel News
Y
Y Combinator Blog
腾讯CDC
F
Fortinet All Blogs
I
InfoQ
N
Netflix TechBlog - Medium
B
Blog RSS Feed
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
量子位
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
云风的 BLOG
云风的 BLOG
A
About on SuperTechFans
Scott Helme
Scott Helme
T
Tor Project blog
U
Unit 42
Google Online Security Blog
Google Online Security Blog
PCI Perspectives
PCI Perspectives
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
NISL@THU
NISL@THU
D
Darknet – Hacking Tools, Hacker News & Cyber Security
aimingoo的专栏
aimingoo的专栏
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
Security Archives - TechRepublic
Security Archives - TechRepublic

好好学习的郝

ClawdBot(OpenClaw)试用记录 编程辅助工具 Codex 入门篇 编程辅助工具 Claude Code 入门篇 Claude API 中转服务 Claude Relay Service LLM 接口管理和分发系统 New API 好好学Git:Git Submodule详解 编程辅助工具Cursor入门篇 好好学Golang:Golang问题记录 One API配置自定义渠道 FastAPI入门篇 好好学Docker:使用Docker安装配置AList 好好学Docker:容器指标查看工具ctop 好好学Docker:自建RustDesk Server 好好学Docker:使用Docker安装配置FileBrowser 邮箱配置中的SPF、DKIM、DMARC记录 One API 开发环境配置 LLM 接口管理和分发系统 One API 好好学K8S:K8S中的Leader Election机制 好好学Golang:Viper库
好好学Linux:Ubuntu18 升级到 Ubuntu22
本文作者: 好好学习的郝 · 2024-11-09 · via 好好学习的郝

1. 为什么要升级Ubuntu?

Ubuntu18 的常规支持已于2023年4月结束,而 Ubuntu22 有更长的常规支持周期,这意味着在未来几年内,用户将持续获得包括功能更新、安全更新和错误修复在内的全面支持,确保系统的稳定性和安全性。

Ubuntu22 采用了较新的 Linux 内核版本,新内核通常会带来更好的硬件支持、性能优化和安全性增强。

此外,最重要的是,很多Ubuntu中的软件仅支持最新版本的Ubuntu,比如Waydroid,比如麟卓卓懿。

因此,虽然升级Ubuntu比较麻烦,并且存在一定的风险,但是是值得的。

参考文档:

2. Ubuntu18升级Ubuntu20

Ubuntu不能跨版本升级,只能逐个版本升级,或者逐个LTS版本升级。因此需要先从Ubuntu18升级到Ubuntu20,再从Ubuntu20升级到Ubuntu22。

2.1. 升级前准备

0、关闭一些软件(可选)

1
2
3
4
5
systemctl stop docker
systemctl disable docker
systemctl stop v2raya
systemctl disable v2raya
vncserver -kill :1

1、修改软件源配置

1
vim /etc/apt/sources.list

添加如下配置:

1
2
3
deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-security main restricted

2、更新软件包

1
2
3
apt update
apt upgrade
apt dist-upgrade

3、删除无用软件包(可选)

1
apt autoremove

4、安装 update-manager-core

1
apt install update-manager-core

5、重启系统

1
reboot

2.2. 执行升级

1、配置使用lts升级

1
vim /etc/update-manager/release-upgrades

如下修改:

1
Prompt=lts

注意:如果配置了 Prompt=never ,那么说明禁用了Ubuntu更新。更新时会提示:

1
2
3
Checking for a new Ubuntu release
In /etc/update-manager/release-upgrades Prompt
is set to never so upgrading is not possible.

参考文档:Can’t upgrade from 18.04 server to 20.04

2、执行升级

1
do-release-upgrade

升级过程会有交互提示,根据提示选择即可。

整个升级过程大约1-2小时。升级完成需要重启一次系统。

3、查看当前版本

1
lsb_release -a

3. Ubuntu20升级到Ubuntu22

不用再次进行升级前准备,直接执行升级命令即可。

1、执行升级

1
do-release-upgrade

升级过程会有交互提示,根据提示选择即可。

Ubuntu20升级Ubuntu22过程中,在 Upgrade to the firefox snap 时会卡住半个小时以上,请耐心等待。详情参考Upgrade Ubuntu 20.04 to 22.04 stuck on ‘’installing the firefox snap’’

2、查看当前版本

1
lsb_release -a