1. Ubuntu16.04

  1. sudo cp /etc/apt/sources.list /etc/apt/sources_origin.list  # 备份
  2. sudo gedit /etc/apt/sources.list  # 删除原来的内容
  1. deb http://mirrors.aliyun.com/ubuntu/ xenial main
  2. deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
  3.  
  4. deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
  5. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
  6.  
  7. deb http://mirrors.aliyun.com/ubuntu/ xenial universe
  8. deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
  9. deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
  10. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
  11.  
  12. deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
  13. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
  14. deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
  15. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
  1. sudo apt-get update

2. Ubuntu18.04

  1. sudo cp /etc/apt/sources.list /etc/apt/sources_origin.list  # 备份
  2. sudo gedit /etc/apt/sources.list  # 删除原来的内容
  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
  2. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
  7. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
  9. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
  1. sudo apt-get update

3. CentOS7

  1. # 1. 备份原镜像文件,便于后期恢复
  2. $ sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  3.  
  4. # 2.下载新的CentOS-Base.repo 到/etc/yum.repos.d/
  5. $ sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  6.  
  7. # 3. 清除缓存
  8. $ sudo yum clean all
  9.  
  10. # 4. 生成缓存
  11. $ sudo yum makecache

参考资料

https://blog.csdn.net/liangontheway/article/details/103509635

Linux更换软件源的更多相关文章

  1. linux centos&Ubuntu&RedHat更换软件源

    linux三大版本更换软件源 前排提示,有的源可能已经失效,如果发现请留言或自行寻找其他源. 1.centos mv /etc/yum.repos.d/CentOS-Base.repo [--path ...

  2. ubuntu更换软件源

     ubuntu更换软件源 /etc/apt/source.list 163: deb http://mirrors.163.com/ubuntu/ trusty main restricted u ...

  3. 个人Linux(ubuntu)使用记录——更换软件源

    说明:记录自己的linux使用过程,并不打算把它当作一个教程,仅仅只是记录下自己使用过程中的一些命令,配置等东西,这样方便自己查阅,也就不用到处去网上搜索了,所以文章毫无章法可言,甚至会记录得很乱 s ...

  4. centos 更换软件源

    最近都在使用国内的VPS.系统统一使用的都是Linux系统.但是,有一些服务商的系统给默认设置的是国外的.这样就会导致下载速度缓慢.于是,找到了国内几家比较热门的镜像点.奉献给大家.下面的镜像全部支持 ...

  5. kali linux 更新软件源,安装中文输入法,修复Linux与windows引导菜单解决windows引导丢失

    1. 更新软件源打开sources.list文件,进行添加更新源:leafpad /etc/apt/sources.list 2. 添加软件源#官方源 deb http://http.kali.org ...

  6. 树莓派学习路程No.1 树莓派系统安装与登录 更换软件源 配置wifi

    在官网下载raspbian系统镜像,用Win32DiskImager写入TF卡 Image File 选择系统镜像,Device 选择TF卡盘符,Write即可.这样系统就写好了.把内存卡插进树莓派里 ...

  7. Linux - 更改软件源

    镜像源 网易镜像源 在网易开源镜像页面,点击对应镜像名的使用帮助,可以查看到更新源的方法,按步骤操作即可. 阿里云镜像源 在阿里云开源镜像页面,点击对应Mirror分类的help标签,可以查看到更新源 ...

  8. linux 命令行下更换软件源

    首先备份默认源: sudo cp /etc/apt/sources.list /etc/apt/sources.list.old 清空默认源: sudo cat /dev/null > /etc ...

  9. linux更换yum源

    由于 redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,重启安装,再配置其他源,以下为详细过程: 1.删除redhat原有的yum rpm - ...

随机推荐

  1. 持久层之 MyBatis: 第三篇 :缓存 And 高级查询

    MyBatis入门到精通3 缓存机制 Mybatis一级缓存测试 Mybatis二级缓存测试 高级查询 表关系说明 一对一查询 一对多查询 多对多查询 缓存机制 正如大多数持久层框架一样,MyBati ...

  2. Python批量创建word文档(2)- 加图片和表格

    Python创建word文档,任务要求:小杨在一家公司上班,每天都需要给不同的客户发送word文档,以告知客户每日黄金价格.要求在文档开始处给出banner条,价格日期等用表格表示.最后贴上自己的联系 ...

  3. Android插件换肤 一.实现原理

    学习缺的不是时间,而是耐心 目的 1.搞懂系统获取资源文件到在加载布局的整个流程是自己实现换肤功能的理论基础 2.提高分析源码.追踪源码的能力 要点 1.XmlResourceParser (通过这个 ...

  4. 身份证前6位地址码+码表+MySQL

    insert into smd_address_code(add_code,address) values('110000','北京市'); insert into smd_address_code( ...

  5. 人脸识别--SeetaFace

    检测:http://download.csdn.net/detail/qq_14845119/9639840 对齐:http://download.csdn.net/detail/qq_1484511 ...

  6. 01 . Go之从零实现Web框架(框架雏形, 上下文Context,路由)

    设计一个框架 大部分时候,我们需要实现一个 Web 应用,第一反应是应该使用哪个框架.不同的框架设计理念和提供的功能有很大的差别.比如 Python 语言的 django和flask,前者大而全,后者 ...

  7. springboot中数据库的连接

    mysql5.0 1.#mysql数据库连接 2.spring.datasource.driver-class-name=com.mysql.jdbc.Driver   3.spring.dataso ...

  8. Android——几种数据存储应用浅谈

    (1)android中的数据存储主要有五种方式: 第一种.sharedPreferences存储数据, 适用范围:保存少量的数据,且这些数据的格式非常简单:字符串型.基本类型的值.比如应用程序的各种配 ...

  9. Redis学习之路(三)常用命令总结

    一.集群 查看Redis集群有多少个库 192.168.200.100:7001> config get databases 1) "databases" 2) " ...

  10. 单细胞分析实录(8): 展示marker基因的4种图形(一)

    今天的内容讲讲单细胞文章中经常出现的展示细胞marker的图:tsne/umap图.热图.堆叠小提琴图.气泡图,每个图我都会用两种方法绘制. 使用的数据来自文献:Single-cell transcr ...