备份
cp -rf /etc/apt/sources.list /etc/apt/sources.list.bak
开始配置
阿里云
sed -i 's@http://archive.ubuntu.com@https://mirrors.aliyun.com@g' /etc/apt/sources.list
sed -i 's@http://security.ubuntu.com@https://mirrors.aliyun.com@g' /etc/apt/sources.list
清华源
sed -i 's@http://archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list
sed -i 's@http://security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list
效果
root@Ser6:~# apt update
Hit:1 https://mirrors.aliyun.com/ubuntu jammy InRelease
Hit:2 https://mirrors.aliyun.com/ubuntu jammy-updates InRelease
Hit:3 https://mirrors.aliyun.com/ubuntu jammy-backports InRelease
Get:4 https://mirrors.aliyun.com/ubuntu jammy-security InRelease [110 kB]
Get:5 https://mirrors.aliyun.com/ubuntu jammy-security/main amd64 Packages [631 kB]
Get:6 https://mirrors.aliyun.com/ubuntu jammy-security/main Translation-en [148 kB]
Get:7 https://mirrors.aliyun.com/ubuntu jammy-security/main amd64 c-n-f Metadata [11.0 kB]
Get:8 https://mirrors.aliyun.com/ubuntu jammy-security/restricted amd64 Packages [651 kB]
Get:9 https://mirrors.aliyun.com/ubuntu jammy-security/restricted Translation-en [104 kB]
Get:10 https://mirrors.aliyun.com/ubuntu jammy-security/restricted amd64 c-n-f Metadata [532 B]
Get:11 https://mirrors.aliyun.com/ubuntu jammy-security/universe amd64 Packages [756 kB]
Get:12 https://mirrors.aliyun.com/ubuntu jammy-security/universe Translation-en [136 kB]
Get:13 https://mirrors.aliyun.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [15.9 kB]
Get:14 https://mirrors.aliyun.com/ubuntu jammy-security/multiverse amd64 Packages [36.5 kB]
Get:15 https://mirrors.aliyun.com/ubuntu jammy-security/multiverse Translation-en [7060 B]
Get:16 https://mirrors.aliyun.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [260 B]
Fetched 2609 kB in 1s (1952 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
65 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@Ser6:~#
文章来源地址https://www.toymoban.com/news/detail-610451.html
文章来源:https://www.toymoban.com/news/detail-610451.html
到了这里,关于Ubuntu通用镜像加速配置的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!