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. [刘阳Java]_Java基础面试中的常识问题

    1. anonymous inner class(匿名内部类)是否可以extends(继承)其它类,是否可以implements(实现)interface(接口)? 不行,对于匿名内部类,看到的一句话 ...

  2. 初探SpringRetry机制

    重试是在网络通讯中非常重要的概念,尤其是在微服务体系内重试显得格外重要.常见的场景是当遇到网络抖动造成的请求失败时,可以按照业务的补偿需求来制定重试策略.Spring框架提供了SpringRetry能 ...

  3. Python语言对Json对象进行新增替换操作

    # Json字符串进行新增操作import jsonimport os# os.path.dirname(__file__):表示当前目录path = os.path.join(os.path.dir ...

  4. python -- 程序异常与调试(异常处理)

    一.异常处理 针对在运行时可能会出错的语句块,可以提前设计好出现问题后的解决方案, 或者给出相应的提示信息.使用try-except语句来处理Python抛出的异常: # -------------- ...

  5. 【Java基础上】一、简述Java

    一.简述Java ​ Java是一种高级的面向对象的程序语言,在此处,不需要了解什么叫做面向对象,因为后面的文章中自然会谈到这方面的论述.那么,Java就是一个计算机的编程语言. 1.1 Java的历 ...

  6. [noip6]模板

    平衡树好题啊 现在暂时还不知道用普通线段树该咋做.... 刚刚做完 二逼平衡树,感觉自己的 \(splay\) 水平有了很大很大的长进,然鹅.... 这题又给我当头一棒.... 然后就一下午出去了但总 ...

  7. vulnhub-DC:3靶机渗透记录

    准备工作 在vulnhub官网下载DC:1靶机www.vulnhub.com/entry/dc-3,312/ 导入到vmware 导入的时候遇到一个问题 解决方法: 点 "虚拟机" ...

  8. jquery 阻止表单提交方法

    <form name="message_form" action="?m=mobilecenter&c=index&a=service" ...

  9. Couchdb 垂直权限绕过漏洞(CVE-2017-12635)

    影响版本:小于 1.7.0 以及 小于 2.1.1 首先,发送如下数据包: 修改数据包 { "type": "user", "name": ...

  10. 不想用Spring全家桶?试试这个国产JFinal框架

    前言 逃离北上广从广州回老家南宁,入职这家公司用的技术是JFinal,借此机会得以学习这个国产的MVC框架,经过一段时间的学习,基于之前的经验搭建一个通用项目jfinal-demo jfinal-de ...