Linux国内可用源
Ubuntu 22.04
阿里源
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
163源
deb http://mirrors.163.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ jammy-backports main restricted universe multiverse
使用方法
-
替换配置文件
- 备份原有源列表:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
- 编辑源列表:
sudo nano /etc/apt/sources.list
- 将内容替换为阿里源或163源。
- 备份原有源列表:
-
更新源
- 更新软件包列表:
sudo apt-get update
- 升级已安装的软件包:
sudo apt-get upgrade
- 更新软件包列表:
CentOS 7.1
阿里源
- 备份原有源:
sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- 下载阿里源:
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- 清理缓存并生成新缓存:
sudo yum clean all sudo yum makecache
163源
- 备份原有源:
sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- 下载163源:
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
- 清理缓存并生成新缓存:
sudo yum clean all sudo yum makecache