一,更换说明

第一步 备份 如centos, mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

第二步 替换,如centos7替换网yum源,运行 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo #centos7

第三步 生成新缓存,如centos,运行 yum clean all && yum makecache

二,常用系统更换脚本

https://mirrors.aliyun.com/epel/

http://mirrors.aliyun.com/repo/

centos7/rhel7,更新阿里云yum源及epel源

#!/bin/sh
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# or curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache

centos8/rhel8,更新阿里云yum源及epel源

#!/bin/sh
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
# or curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
wget https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
rpm -ivh epel-release-latest-8.noarch.rpm
rm -f epel-release-latest-8.noarch.rpm
yum clean all
yum makecache

ubuntu18.04(bionic), 更换apt源为阿里云源

#!/bin/sh
mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "\
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
">/etc/apt/sources.list
apt-get update
# apt-get update -y

ubuntu16.04, 更换apt源为阿里云源

#!/bin/sh
mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "\
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
">/etc/apt/sources.list
apt-get update
# apt-get update -y

三、国内主要镜像站点

3.1 阿里云 https://developer.aliyun.com/mirror

3.2 网易 http://mirrors.163.com/

3.3 搜狐 http://mirrors.sohu.com/

3.4 腾讯 https://mirrors.cloud.tencent.com/

3.5 中国科大 http://mirrors.ustc.edu.cn/

3.6 清华大学 https://mirrors.tuna.tsinghua.edu.cn/

3.7 华中科大 http://mirror.hust.edu.cn/

3.8 重庆大学 http://mirrors.cqu.edu.cn/

Linux系统国内镜像站点的更多相关文章

  1. 十分钟内在Ubuntu系统上搭建Mono开发环境(Mono软件Ubuntu系统国内镜像源、Mono国内镜像源)

    Mono软件Ubuntu系统国内镜像源.Mono国内镜像源 http://download.githall.cn/repo 替换为国内源(非官方)有利于加快mono的安装速度,一般情况下,完成mono ...

  2. eclipse使用国内镜像站点安装插件

    把eclipse 4.x的界面改为经典样式 打开eclipse,菜单栏>windows>preference>general>appearance>theme>cl ...

  3. Remastersys备份linux系统ISO镜像

    1. 安装Remastersys 利用Ubuntu Software Center安装,修改sources.list文件,在文件末尾加入下面三行,添加软件源, #Rsudo remastersys d ...

  4. Linux——使用国内镜像通过pip安装python的一些包

    学习flask,安装virtualenv环境,这些带都ok,但是一安装包总是出错无法安装, http://e.pypi.python.org/这个就是官网了,清华大学提供的 建议非清华大学校内的使用这 ...

  5. window下从硬盘安装linux系统iso镜像文件的方法

    首先,需要安装grub2win,http://sourceforge.net/projects/grub2win/ 其次,将iso文件放在grub2可识别的分区, 如c:\abc\iso.iso 最后 ...

  6. Linux系统的镜像文件iso下载地址

    CentOS-6.1-x86_64-bin-DVD1.iso 官方网址:http://archive.kernel.org/centos-vault/6.1/isos/x86_64/ 下载链接地址:h ...

  7. Linux系统各发行版镜像下载

    Linux系统各发行版镜像下载(2014年10月更新),如果直接下载不了,请使用迅雷下载.并且注意,我的下载地址,在 迅雷 里才起作用. 包括Ubuntu,Fedora,SUSE,Red Hat En ...

  8. Linux系统各发行版镜像下载(借阅)

    Linux各个版本资源下载 Linux系统各发行版镜像下载(持续更新) == Linux系统各发行版镜像下载(2014年10月更新),如果直接下载不了,请使用迅雷下载.并且注意,我的下载地址,在  迅 ...

  9. Linux系统各发行版镜像下载(持续更新)

    Linux系统各发行版镜像下载(持续更新) http://www.linuxidc.com/Linux/2007-09/7399.htm Linux系统各发行版镜像下载(2014年10月更新),如果直 ...

随机推荐

  1. EXCEL排序(hdu 1862)

    其实这个题吧,就是发出来玩玩,会用sort就很easy了,有一个小小的知识点:比较字符串字典序的大小用strcmp函数. strcmp(a,b)<0说明a的字典序小于b的字典序. 上题: Inp ...

  2. 用Maven整合SSM项目实例

     转自https://www.cnblogs.com/hujianblogs/p/8526737.html 本人在学习Maven之余,为了深入了解Maven的用法,决定创建一个SSM整合实例.项目是自 ...

  3. python从命令窗口启动脚本 创建并写入内容到文件示例

    写入到文件示例: #!/usr/bin/env python3 from math import exp, log, sqrt import re from datetime import date, ...

  4. Java 14 都要来了,为什么还有这么多人固守Java8?

    作者:刘欣 从Java 9开始,Java版本的发布就让人眼花缭乱了. 每隔6个月,都会冒出一个新版本出来,Java 10 , Java 11, Java 12, Java 13, 到2020年3月份, ...

  5. 18 11 26 用多进程 多线程 携程 实现 http 服务器的创建

    下面是一个  多进程 服务器的创建 import socket import re import multiprocessing def service_client(new_socket): &qu ...

  6. 百度链接提交-js代码推送批量推送版

    1原百度JS链接推送代码 首先我们来看一下原百度JS链接推送代码是这*样的 用百度自己的话讲:JS链接推送代码以网页为最小对象,服务于全平台多终端,PC站和移动站均可使用.安装代码的页面在任意平台(浏 ...

  7. javaweb03 javaservlet基础一

    1.使用JavaEE版的eclipse开发动态的WEB工程(JavaWEB 项目)1).把开发选项切换到JavaEE2).可以在window -> Show View 中找到Package Ex ...

  8. 详细的git入门级别,从安装到实战

    拥有自己码云开源网站,想要上传项目到码云怎么操作?公司新技术提升由Svn转为Git,慌不慌?想要从Github开源网站下载开源项目,难道还依赖直接下载项目然后解压导入项目工程?下面可以通过及其简易且好 ...

  9. CodeForces 1287B Hyperset

    N^2遍历所有得(i,j)然后可以根据(i,j)字符串构造出来第三个T字符串,然后查找一下是否有这个T存在即可,注意最后答案要/3因为会重复出现. #include <stdio.h> # ...

  10. 201509-2 日期计算 Java

    思路: 每月有多少天是固定的,放到数组中,2月单独判断一下. import java.util.Scanner; public class Main { public static void main ...