linux在下软件太卡?手把手教你配置国内镜像源
时间:2020-04-13
本文章向大家介绍linux在下软件太卡?手把手教你配置国内镜像源,主要包括linux在下软件太卡?手把手教你配置国内镜像源使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
ubuntu18.04 配置国内镜像源
修改配置文件
-
手动更改
- 用你熟悉的编辑器打开
/etc/apt/sources.list
,例如vi /etc/apt/sources.list
- 以
ubuntu 18.04(bionic)
为例把下列内容复制替换sources.list
中的全部内容(使用阿里云镜像):
- 以
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
- 用你熟悉的编辑器打开
-
一键更改
通过
wget
获取配置文件(前提你的电脑得有wget,没有的话运行sudo apt-get install wget
),例如获取ubuntu18.04的配置文件为例(使用腾讯云镜像),阿里云镜像没有找到现成的配置文件,用腾讯云代替wget -O /etc/apt/sources.list http://mirrors.cloud.tencent.com/repo/ubuntu18_sources.list
其他版本可在阿里云或者腾讯云镜像查看即可。
更新缓存
apt-get clean all
apt-get update
Centos7 配置国内镜像源
和ubuntu基本类似,只是文件路径稍有不同
-
下载新的
CentOS-Base.repo
文件到/etc/yum.repos.d/
例如:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
-
或者使用
vi /etc/yum.repos.d/CentOS-Base.repo
替换成一下内容# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
- 最后运行更新缓存
yum clean all yum makecache
原文地址:https://www.cnblogs.com/lxy0/p/12694270.html
- 按分类统计商品总数的性能优化思考
- 机器学习之Python基础(一)
- 中国造机器人突破新高,将大量挤压就业空间,明天在哪里打工?
- 嵌入式数据库Perst
- USB 设备的PID-Product ID,VID-Vendor ID
- Asp.Net4.0/VS2010新变化(3):webform中也可以直接url路由
- IIS7上部署Asp.Net4.0时UrlRouting的若干问题
- As3.0中的反射
- 域名yg.cc以10.2万元的价格结拍,可搭建“摇滚”音乐平台
- 修改 Windows Host 文件工具
- win7下恢复“经典任务栏”/“快速启动栏”,关闭“窗口自动最大化”
- WCF和ASP.NET Web API 接口执行时间监控
- 额的神啊:AS3中Button被disable了,也会触发Click事件!
- [原创]CI持续集成系统环境---部署gerrit环境完整记录
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- 一文透析SpringCloud,关于Bus消息总线,总算梳理清楚了
- LeetCode 102. 二叉树的层序遍历
- 剑指Offer LeetCode 面试题10- II. 青蛙跳台阶问题
- 剑指Offer LeetCode 面试题10- I. 斐波那契数列
- 蓝桥杯 1的个数
- 蓝桥杯-试题 算法训练 数据交换
- 解决mysql导入新数据库大小写问题(Table 'zup.Domain_System' doesn't exist)
- 蓝桥杯vip试题 报时助手
- 蓝桥杯-基础练习 查找整数
- 蓝桥杯-基础练习 数列排序
- 无线网络-何为ISM频段?
- 蓝桥杯vip测试题系统试题-算法提高 矩阵转置
- 蓝桥杯vip测试题系统-数组求和(解题思路以及解题代码,手画思路图虽然丑丑的)
- 蓝桥杯vip测试题-找零钱(解题思路以及解题代码)
- 剑指Office-二进制中1的个数