Ubuntu采用apt作为软件安装工具,其镜像源列表记录在/etc/apt/source.list文件中。
首先将source.list复制为source.list.bak备份。
cp /etc/apt/source.list /etc/apt/source.list.bak
修改完成后保存source.list文件,需要执行命令后才能生效:
sudo apt update
本文为 Ubuntu 22.04 的阿里云镜像源列表。若为其他版本,将所有jammy更改为其他版本代号即可。
常用的Ubuntu版本代号如下:
Ubuntu 22.04:jammy
Ubuntu 20.04:focal
Ubuntu 18.04:bionic
Ubuntu 16.04:xenia文章来源:https://www.toymoban.com/news/detail-658894.html
vim /etc/apt/source.list
将文件内容清空,然后复制下方代码粘贴,wq保存退出即可。文章来源地址https://www.toymoban.com/news/detail-658894.html
deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
# deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
到了这里,关于Ubuntu22.04更换国内镜像源(阿里云)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!