linux修改源镜像地址

1.1 CentOS修改yum源镜像地址为:mirrors.163.com (也可以改为阿里云镜像)

1、首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo

[root@iZ91q68xe2hhxlZ yum.repos.d]#  mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

2、进入yum源配置文件所在的文件夹

[root@iZ91q68xe2hhxlZ yum.repos.d]# cd /etc/yum.repos.d/

3、下载163的yum源配置文件(CentOS7)

[root@iZ91q68xe2hhxlZ yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

1.2 Ubuntu修改apt-get源

1、首先备份系统自带apt-get源配置文件/etc/apt/sources.list

cp /etc/apt/sources.list /etc/apt/sources.list.bak

2、编辑源配置文件/etc/apt/sources.list,替换内容为:

#阿里云源

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

#清华大学源

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse   

3、更新测试一下

apt-get update
展开阅读全文

没有更多推荐了,返回首页