前言
由于Ubuntu 每个发行版( 22.04 Jammy Jellyfish)都对应一个独立的软件仓库快照,包含:
特定版本的软件包( python 3.10 for ubuntu 22.04,python 3.12 for ubuntu 24.04)
严格匹配的内核与依赖库(glibc、systemd)
专属的安全补丁分支
查看系统版本
1 | # 查看操作系统版本 |
备份镜像源
1 | # 备份源列表 |
更换源
1 | sudo gedit /etc/apt/sources.list |
20.04
阿里云开源镜像站
1 | deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse |
网易开源镜像站
1 | deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse |
清华大学开源镜像站
1 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse |
22.04
阿里云开源镜像站
1 | deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse |
网易开源镜像站
1 | deb http://mirrors.163.com/ubuntu/ jammy main restricted universe multiverse |
清华大学开源镜像站
1 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse |
更新
更新软件包索引,若不执行该指令则继续使用旧源的软件包列表,无法获取新内容,该指令并不会更新系统中任何已安装的软件包
1 | sudo apt update |
(可选)执行sudo apt upgrade 指令将所有已安装的软件包更新到最新版本
1 | sudo apt upgrade |