52 lines
1.1 KiB
Markdown
52 lines
1.1 KiB
Markdown
# Ubuntu 系统升级
|
|
|
|
*不是升级软件包,而是升级整个系统。*
|
|
|
|
## 1. 查看当前系统版本
|
|
|
|
```bash
|
|
lsb_release -a
|
|
# Or
|
|
cat /etc/issue
|
|
```
|
|
|
|
## 2. 从命令行升级
|
|
|
|
先升级软件包
|
|
|
|
```bash
|
|
sudo apt update && sudo apt dist-upgrade
|
|
```
|
|
|
|
如果没有 update-manager-core 需要先安装
|
|
|
|
```bash
|
|
sudo apt install update-manager-core
|
|
```
|
|
|
|
如果希望从 LTS 升级到非 LTS 版本,还需要修改 /etc/update-manager/release-upgrades
|
|
|
|
```ini
|
|
# /etc/update-manager/release-upgrades
|
|
# 将 Prompt=lts 修改为如下内容
|
|
Prompt=normal
|
|
```
|
|
|
|
之后输入以下命令进行系统升级:
|
|
|
|
```bash
|
|
sudo do-release-upgrade
|
|
```
|
|
|
|
如果升级过程中出现了“Upgrade tool 404 Not Found [IP: 59.80.44.45 80]”字样错误,可以尝试修改 /etc/apt/sources.list 为国内(如清华)镜像。
|
|
|
|
## 3. 关闭自动升级
|
|
|
|
修改 /etc/apt/apt.conf.d/10periodic 文件中的 APT::Periodic::Update-Package-Lists 为零。
|
|
|
|
```bash
|
|
APT::Periodic::Update-Package-Lists "0";
|
|
APT::Periodic::Download-Upgradeable-Packages "0";
|
|
APT::Periodic::AutocleanInterval "0";
|
|
```
|