1
0
md/ubuntu-sources-22.04.md

35 lines
821 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

备份 source.list 文件
```
cp /etc/apt/sources.list /etc/apt/sources.list.bak
```
```
vim /etc/apt/sources.list
```
复制粘贴
```
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
```
更新
```
apt update
```
升级现有软件包(可选)
```
apt upgrade
```
修改 PPA 和第三方源(如果有的话)
```
/etc/apt/sources.list.d/
```
替换 ppa 文件的URL一般将 ppa.launchpad.net 修改为 ppa.mirrors.aliyun.com
```
deb http://ppa.mirrors.aliyun.com/ppa/username/repositoryname/ jammy main
```