一,更换说明

第一步 备份 如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. vue-cli3.x 搭建项目目

    安装文档 https://cli.vuejs.org/zh/guide/ 安装条件 npm 更至最新 node >=8.9 可以用npm -v 查看npm的版本号 1.关于旧版本 Vue CLI ...

  2. python刷LeetCode:20. 有效的括号

    难度等级:简单 题目描述: 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效. 有效字符串需满足: 左括号必须用相同类型的右括号闭合.左括号必须以正确的顺序 ...

  3. 好文推荐:终于有人把Elasticsearch原理讲透了

    专注于Java领域优质技术,欢迎关注 作者:channingbreeze 转自公号:互联网侦察 小史是一个非科班的程序员,虽然学的是电子专业,但是通过自己的努力成功通过了面试,现在要开始迎接新生活了. ...

  4. CodeForces - 748D Santa Claus and a Palindrome (贪心+构造)

    题意:给定k个长度为n的字符串,每个字符串有一个魅力值ai,在k个字符串中选取字符串组成回文串,使得组成的回文串魅力值最大. 分析: 1.若某字符串不是回文串a,但有与之对称的串b,将串a和串b所有的 ...

  5. POJ 3013 SPFA算法,邻接表的使用

    Big Christmas Tree Time Limit: 3000MS   Memory Limit: 131072K Total Submissions: 19029   Accepted: 4 ...

  6. 9.scrapy pycharm调试小技巧,请求一次,下次直接调试,不必每次都启动整个爬虫,重新请求一整遍

    pycharm调试技巧:调试时,请求一次,下次直接调试,不必每次都启动整个爬虫,重新请求一整遍 [用法]cmd命令运行:scrapy shell 网址 第一步,cmd进行一次请求: scrapy sh ...

  7. 吴裕雄--天生自然 JAVASCRIPT开发学习: DOM 事件

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  8. HDU-2087 C - 剪花布条(KMP基本)

    http://acm.hdu.edu.cn/showproblem.php?pid=2087 一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案.对于给定的花布条和小饰条,计算一下能 ...

  9. linux下的hashpump安装

    hashpump是linux上的一个进行hash长度拓展攻击的工具 安装: git clone https://github.com/bwall/HashPump apt-get install g+ ...

  10. Thread--两线程交替打印

    package t3.copy; public class ThreadA extends Thread { private Object lock; public ThreadA(Object lo ...