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
1
2
3
4
5
6
7
8
9
10
#清华大学源

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
1
2
3
4
5
6
7
8
9
10
3、更新测试一下

apt-get update
————————————————

原文链接:https://blog.csdn.net/qq_39263240/article/details/79342582

linux修改源镜像地址的更多相关文章

  1. 配置Linux本地源镜像

    今天看到同事做了一个公司本地的apache镜像源,感觉好叼的样子.然后就自己上网找些资料,尝试自己搭建一套出来.然后就有了这篇博文... 声明:本文中充满了浓浓的技术嫉妒的心理,阅读需谨慎. 本文以 ...

  2. Unraid修改docker镜像地址&默认启动

    起源 由于Unraid系统每次启动都会清空Docker的镜像地址配置,故需要默认配置镜像地址 方法 添加修改镜像脚本到开机文件中实现 先找一个镜像加速地址,我使用的是阿里云的容器镜像服务 形如 :ht ...

  3. 修改nvm镜像地址

    最近几个项目切换开发要求Node版本不一样,没法运行.需要用nvm或n等来管理node版本,选谁见仁见智了,反正我选了nvm. 下载个node慢得要死,等半天结果还失败,真是窝火.官方文档又详细过了一 ...

  4. python学习笔记 | 国内常用源镜像地址

    各镜像列表 清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 ...

  5. 免费yum源镜像地址

    收集的镜像,yum源等网站地址 阿里巴巴开源镜像站 https://opsx.alibaba.com/mirror http://mirrors.aliyun.com/centos/ 网易开源镜像站 ...

  6. Docker系列06:Linux修改docker镜像和容器数据存储位置

    指定镜像和容器存放路径的参数是--graph=/var/lib/docker,其默认存储位置为/var/lib/docker, Docker 的配置文件可以设置大部分的后台进程参数,在各个操作系统中的 ...

  7. Docker 修改国内镜像地址

    curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://86d2a50b.m.daocloud.io 该脚本可以 ...

  8. 修改docker镜像地址

    vim /etc/docker/daemon.json,使用国内加速站点镜像 https://registry.docker-cn.com http://hub-mirror.c.163.com ht ...

  9. 树莓派(Linux)与镜像源

    树莓派学习笔记--修改树莓派软件源 1. linux 镜像源文件 >> vim /etc/apt/sources.list 可在树莓派官网 http://www.raspbian.org/ ...

随机推荐

  1. Eclipse配置反编译插件jadclipse

    参考自:https://blog.csdn.net/moneyshi/article/details/79715891 Jad是一个Java的一个反编译工具,是用命令行执行,和通常JDK自带的java ...

  2. Java集合 - 初始化写法

    List的初始化方法 方法一 List<Integer> list= new ArrayList<Integer>(){{ add(1); add(2); add(3); }} ...

  3. 第十一篇 -- QMainWindow与QAction(斜体-粗体-下划线)

    效果图: ui_mainWindow.py # -*- coding: utf-8 -*- # Form implementation generated from reading ui file ' ...

  4. create-react-app 创建的项目执行npm run eject后,运行报错

    create-react-app 创建的项目执行npm run eject后,运行报错:Cannot find module '@babel/plugin-transform-react-jsx-so ...

  5. intouch制作历史报警查询(时间查询,筛选关键字)

    在项目中,intouch制作历史报警查询已属于标配功能,如何做出按时间以及关键字来进行综合查询,提高历史报警查询效率仍然是一个值得研究的问题,接下来参考网上文章自己总结下如何制作. 1.DTPicke ...

  6. sqli-labs靶机

    第一关   1' 第二关   1 第三关    1') 第四关    1'') 第五关   1'     +         extractvalue报错注入 第六关   1 "  +    ...

  7. IDEA输出乱码“淇℃伅”

    尝试过在IDEA中tomcat的vmoptions中加入代码 -Dfile.encoding=GBK 没什么用 最后找到了这个方法 参考链接 ①在Tomcat文件夹下找到conf ②找到logging ...

  8. Js实现随机某个li样式增加

    一.首先引入jquery  cdn   二.基础样式 三.目的 为了使随机某个li背后有个旋转的图片 四.核心代码 html代码: <div class="bg3"> ...

  9. Spring Cloud 专题之七:Sleuth 服务跟踪

    书接上回: SpringCloud专题之一:Eureka Spring Cloud专题之二:OpenFeign Spring Cloud专题之三:Hystrix Spring Cloud 专题之四:Z ...

  10. 《微服务架构设计模式》读书笔记 | 第4章 使用Saga管理事务

    目录 前言 1. 微服务架构下的事务管理 1.1 分布式事务的挑战 1.2 一个Saga的示例 1.3 Saga使用补偿事务来回滚所作出的改变 2. Saga的协调模式 2.1 两种Saga协调模式 ...